fix emoji
This commit is contained in:
parent
0071cb09a9
commit
da147417e9
|
@ -71,20 +71,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
const driveFile = await this.driveFilesRepository.findOneBy({ id: ps.fileId });
|
const driveFile = await this.driveFilesRepository.findOneBy({ id: ps.fileId });
|
||||||
if (driveFile == null) throw new ApiError(meta.errors.noSuchFile);
|
if (driveFile == null) throw new ApiError(meta.errors.noSuchFile);
|
||||||
|
|
||||||
const duplicationEmoji = await this.emojisRepository.find({
|
|
||||||
where: {
|
|
||||||
name: ps.name,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
duplicationEmoji.forEach(
|
|
||||||
(emoji) => {
|
|
||||||
if (emoji.name === ps.name) {
|
|
||||||
throw new ApiError(meta.errors.duplicationEmojiAdd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
const emoji = await this.customEmojiService.add({
|
const emoji = await this.customEmojiService.add({
|
||||||
driveFile,
|
driveFile,
|
||||||
name: ps.name,
|
name: ps.name,
|
||||||
|
|
Loading…
Reference in New Issue