1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-22 05:19:22 +00:00
This commit is contained in:
Pierre HUBERT 2020-04-29 16:49:08 +02:00
parent aabf47fea4
commit 550b932919

View File

@ -269,10 +269,10 @@ export class SettingsController {
* @param h Request handler * @param h Request handler
*/ */
public static async UploadCustomEmoji(h: RequestHandler) { public static async UploadCustomEmoji(h: RequestHandler) {
const shorcut = h.postEmojiShorcut("shortcut"); const shortcut = h.postEmojiShorcut("shortcut");
// Check if the user has already a shortcut with the same name // Check if the user has already a shortcut with the same name
if(await CustomEmojisHelper.HasUserSimilarShorcut(h.getUserId(), shorcut)) if(await CustomEmojisHelper.HasUserSimilarShorcut(h.getUserId(), shortcut))
h.error(401, "A custom emoji with the same shortcut is already defined!") h.error(401, "A custom emoji with the same shortcut is already defined!")
@ -282,7 +282,7 @@ export class SettingsController {
const emojiID = await CustomEmojisHelper.Insert(new CustomEmoji({ const emojiID = await CustomEmojisHelper.Insert(new CustomEmoji({
id: -1, id: -1,
userID: h.getUserId(), userID: h.getUserId(),
shorcut: shorcut, shorcut: shortcut,
path: path path: path
})) }))