feat: allow specify if notification is success or error
This commit is contained in:
parent
386c18a1bc
commit
f5b5f3751e
1 changed files with 15 additions and 5 deletions
|
|
@ -473,11 +473,21 @@ export class BackupController extends Controller {
|
|||
|
||||
@Post("notify")
|
||||
async notifyBackup(
|
||||
@Body() payload: { message: string; userId?: string | string[]; roles?: string | string[] },
|
||||
@Body()
|
||||
payload: {
|
||||
message: string;
|
||||
userId?: string | string[];
|
||||
roles?: string | string[];
|
||||
error?: boolean;
|
||||
},
|
||||
) {
|
||||
sendWebSocket("backup-notification", payload.message, {
|
||||
roles: payload.roles || [],
|
||||
userId: payload.userId || [],
|
||||
});
|
||||
sendWebSocket(
|
||||
"backup-notification",
|
||||
{ success: !payload.error, message: payload.message },
|
||||
{
|
||||
roles: payload.roles || [],
|
||||
userId: payload.userId || [],
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue