feat: federate flag creation

This commit is contained in:
Opliko
2024-04-14 00:51:53 +02:00
parent 7bacbf76f0
commit 2a2b855fe2
7 changed files with 56 additions and 13 deletions

View File

@@ -11,7 +11,7 @@ flagsApi.create = async (caller, data) => {
throw new Error('[[error:invalid-data]]');
}
const { type, id, reason } = data;
const { type, id, reason, notifyRemote } = data;
await flags.validate({
uid: caller.uid,
@@ -19,7 +19,7 @@ flagsApi.create = async (caller, data) => {
id: id,
});
const flagObj = await flags.create(type, id, caller.uid, reason);
const flagObj = await flags.create(type, id, caller.uid, reason, undefined, undefined, notifyRemote);
flags.notify(flagObj, caller.uid);
return flagObj;