Impostors

This commit is contained in:
Natsumi
2023-11-22 02:04:26 +13:00
parent 2e9db3153d
commit 9c9a404dcf
3 changed files with 64 additions and 2 deletions

View File

@@ -3054,6 +3054,42 @@ speechSynthesis.getVoices();
});
};
/*
params: {
avatarId: string
}
*/
API.createImposter = function (params) {
return this.call(`avatars/${params.avatarId}/impostor/enqueue`, {
method: 'POST'
}).then((json) => {
var args = {
json,
params
};
this.$emit('AVATAR:IMPOSTER:CREATE', args);
return args;
});
};
/*
params: {
avatarId: string
}
*/
API.deleteImposter = function (params) {
return this.call(`avatars/${params.avatarId}/impostor`, {
method: 'DELETE'
}).then((json) => {
var args = {
json,
params
};
this.$emit('AVATAR:IMPOSTER:DELETE', args);
return args;
});
};
// #endregion
// #region | API: Notification
@@ -18626,6 +18662,28 @@ speechSynthesis.getVoices();
return args;
});
break;
case 'Delete Imposter':
API.deleteImposter({
avatarId: D.id
}).then((args) => {
this.$message({
message: 'Imposter deleted',
type: 'success'
});
return args;
});
break;
case 'Create Imposter':
API.createImposter({
avatarId: D.id
}).then((args) => {
this.$message({
message: 'Imposter queued for creation',
type: 'success'
});
return args;
});
break;
}
}
});