chore: minor tweak

This commit is contained in:
AlexAlexandre 2022-02-15 11:46:54 -03:00
parent 121b54ea9a
commit 51b59a3b84
1 changed files with 11 additions and 1 deletions

View File

@ -15,7 +15,17 @@ export async function setRoles(): Promise<void> {
reduxStore.dispatch(setRolesAction(parsed)); reduxStore.dispatch(setRolesAction(parsed));
} }
export async function onRolesChanged(ddpMessage: any) { interface IRolesChanged {
fields: {
args: {
type: string;
_id: string;
description: string;
}[];
};
}
export async function onRolesChanged(ddpMessage: IRolesChanged): Promise<void> {
const { type, _id, description } = ddpMessage.fields.args[0]; const { type, _id, description } = ddpMessage.fields.args[0];
if (/changed/.test(type)) { if (/changed/.test(type)) {
const db = database.active; const db = database.active;