Skip to content

Commit

Permalink
chore!: removed removeWebdavAccount method (#33355)
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
  • Loading branch information
abhinavkrin authored and MartinSchoeler committed Oct 14, 2024
1 parent fd57d74 commit aeecdda
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 45 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-singers-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

This adjustment removes the deprecated `removeWebdavAccount` method. Moving forward, use the `webdav.removeWebdavAccount` endpoint to remove WebDAV accounts.
12 changes: 10 additions & 2 deletions apps/meteor/app/api/server/v1/webdav.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { api } from '@rocket.chat/core-services';
import { WebdavAccounts } from '@rocket.chat/models';
import Ajv from 'ajv';

import { API } from '../api';
Expand Down Expand Up @@ -45,9 +47,15 @@ API.v1.addRoute(
async post() {
const { accountId } = this.bodyParams;

const result = await Meteor.callAsync('removeWebdavAccount', accountId);
const removed = await WebdavAccounts.removeByUserAndId(accountId, this.userId);
if (removed) {
void api.broadcast('notify.webdav', this.userId, {
type: 'removed',
account: { _id: accountId },
});
}

return API.v1.success({ result });
return API.v1.success({ result: removed });
},
},
);
1 change: 0 additions & 1 deletion apps/meteor/app/webdav/server/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import './methods/addWebdavAccount';
import './methods/removeWebdavAccount';
import './methods/getWebdavFileList';
import './methods/getWebdavFilePreview';
import './methods/getFileFromWebdav';
Expand Down
42 changes: 0 additions & 42 deletions apps/meteor/app/webdav/server/methods/removeWebdavAccount.ts

This file was deleted.

0 comments on commit aeecdda

Please sign in to comment.