Skip to content

Commit

Permalink
Do not require params on client
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusbsilva137 committed Jan 11, 2024
1 parent f223e70 commit 00a0092
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ function ActionSettingInput({ _id, actionText, value, disabled, sectionChanged }

const handleClick = async (): Promise<void> => {
try {
const data: { message: TranslationKey; params: string[] } = await actionMethod();
const data: { message: TranslationKey; params?: string[] } = await actionMethod();

dispatchToastMessage({ type: 'success', message: t(data.message, ...data.params) });
const params = data.params || [];
dispatchToastMessage({ type: 'success', message: t(data.message, ...params) });
} catch (error) {
dispatchToastMessage({ type: 'error', message: error });
}
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/server/methods/OEmbedCacheCleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { settings } from '../../app/settings/server';
declare module '@rocket.chat/ui-contexts' {
// eslint-disable-next-line @typescript-eslint/naming-convention
interface ServerMethods {
OEmbedCacheCleanup(): { message: string; params: unknown[] };
OEmbedCacheCleanup(): { message: string };
}
}

Expand All @@ -31,7 +31,6 @@ Meteor.methods<ServerMethods>({
await executeClearOEmbedCache();
return {
message: 'cache_cleared',
params: [],
};
},
});

0 comments on commit 00a0092

Please sign in to comment.