fix: なんかアホみたいなバグfix
This commit is contained in:
parent
365b5eaa70
commit
0e5d164acc
|
@ -74,15 +74,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
if (emoji == null) {
|
||||
throw new ApiError(meta.errors.noSuchEmoji);
|
||||
}
|
||||
|
||||
let driveFile: MiDriveFile;
|
||||
|
||||
try {
|
||||
// Create file
|
||||
driveFile = await this.driveService.uploadFromUrl({ url: emoji.originalUrl, user: null, force: true });
|
||||
} catch (e) {
|
||||
throw new ApiError();
|
||||
}
|
||||
const existEmoji = await this.emojisRepository.exist({
|
||||
where: {
|
||||
name: emoji.name,
|
||||
|
@ -92,6 +83,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
if (existEmoji) {
|
||||
throw new ApiError(meta.errors.duplicationEmojiAdd);
|
||||
}
|
||||
let driveFile: MiDriveFile;
|
||||
|
||||
try {
|
||||
// Create file
|
||||
driveFile = await this.driveService.uploadFromUrl({ url: emoji.originalUrl, user: null, force: true });
|
||||
} catch (e) {
|
||||
throw new ApiError();
|
||||
}
|
||||
|
||||
const copied = await this.emojisRepository.insert({
|
||||
id: this.idService.genId(),
|
||||
|
|
Loading…
Reference in New Issue