Skip to content

Commit

Permalink
chore!: removed removeWebdavAccount method
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinav Kumar <[email protected]>
  • Loading branch information
abhinavkrin committed Sep 25, 2024
1 parent cb512e1 commit f8eb7ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 45 deletions.
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 f8eb7ad

Please sign in to comment.