mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-25 15:35:12 +00:00
style(backend): fix all eslint errors (#9967)
This commit is contained in:
parent
7c5fc2c423
commit
8f9ce23e52
9 changed files with 11 additions and 12 deletions
|
@ -107,7 +107,7 @@ export class ImageProcessingService {
|
||||||
withoutEnlargement: true,
|
withoutEnlargement: true,
|
||||||
})
|
})
|
||||||
.rotate()
|
.rotate()
|
||||||
.webp(options)
|
.webp(options);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
data,
|
data,
|
||||||
|
|
|
@ -40,7 +40,6 @@ function truncateBody<T extends keyof pushNotificationsTypes>(type: T, body: pus
|
||||||
},
|
},
|
||||||
} : {}),
|
} : {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|
|
@ -53,7 +53,7 @@ export class VideoProcessingService {
|
||||||
thumbnail: '1',
|
thumbnail: '1',
|
||||||
url,
|
url,
|
||||||
})
|
})
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ export class EmojiEntityService {
|
||||||
src: Emoji['id'] | Emoji,
|
src: Emoji['id'] | Emoji,
|
||||||
opts: { omitHost?: boolean; omitId?: boolean; withUrl?: boolean; } = { omitHost: true, omitId: true, withUrl: true },
|
opts: { omitHost?: boolean; omitId?: boolean; withUrl?: boolean; } = { omitHost: true, omitId: true, withUrl: true },
|
||||||
): Promise<Packed<'Emoji'>> {
|
): Promise<Packed<'Emoji'>> {
|
||||||
opts = { omitHost: true, omitId: true, withUrl: true, ...opts }
|
opts = { omitHost: true, omitId: true, withUrl: true, ...opts };
|
||||||
|
|
||||||
const emoji = typeof src === 'object' ? src : await this.emojisRepository.findOneByOrFail({ id: src });
|
const emoji = typeof src === 'object' ? src : await this.emojisRepository.findOneByOrFail({ id: src });
|
||||||
|
|
||||||
|
|
|
@ -395,7 +395,7 @@ export class FileServerService {
|
||||||
state: 'remote',
|
state: 'remote',
|
||||||
mime, ext,
|
mime, ext,
|
||||||
path, cleanup,
|
path, cleanup,
|
||||||
}
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
cleanup();
|
cleanup();
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -429,7 +429,7 @@ export class FileServerService {
|
||||||
url: file.uri,
|
url: file.uri,
|
||||||
fileRole: isThumbnail ? 'thumbnail' : isWebpublic ? 'webpublic' : 'original',
|
fileRole: isThumbnail ? 'thumbnail' : isWebpublic ? 'webpublic' : 'original',
|
||||||
file,
|
file,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const path = this.internalStorageService.resolvePath(key);
|
const path = this.internalStorageService.resolvePath(key);
|
||||||
|
@ -452,6 +452,6 @@ export class FileServerService {
|
||||||
mime: file.type,
|
mime: file.type,
|
||||||
ext: null,
|
ext: null,
|
||||||
path,
|
path,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
private queryService: QueryService,
|
private queryService: QueryService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const query = this.queryService.makePaginationQuery(this.adsRepository.createQueryBuilder('ad'), ps.sinceId, ps.untilId)
|
const query = this.queryService.makePaginationQuery(this.adsRepository.createQueryBuilder('ad'), ps.sinceId, ps.untilId);
|
||||||
const ads = await query.take(ps.limit).getMany();
|
const ads = await query.take(ps.limit).getMany();
|
||||||
|
|
||||||
return ads;
|
return ads;
|
||||||
|
|
|
@ -57,7 +57,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
await this.db.queryResultCache!.remove(['meta_emojis']);
|
await this.db.queryResultCache!.remove(['meta_emojis']);
|
||||||
|
|
||||||
this.globalEventService.publishBroadcastStream('emojiDeleted', {
|
this.globalEventService.publishBroadcastStream('emojiDeleted', {
|
||||||
emojis: [ await this.emojiEntityService.pack(emoji) ],
|
emojis: [await this.emojiEntityService.pack(emoji)],
|
||||||
});
|
});
|
||||||
|
|
||||||
this.moderationLogService.insertModerationLog(me, 'deleteEmoji', {
|
this.moderationLogService.insertModerationLog(me, 'deleteEmoji', {
|
||||||
|
|
|
@ -72,11 +72,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
|
|
||||||
if (emoji.name === ps.name) {
|
if (emoji.name === ps.name) {
|
||||||
this.globalEventService.publishBroadcastStream('emojiUpdated', {
|
this.globalEventService.publishBroadcastStream('emojiUpdated', {
|
||||||
emojis: [ updated ],
|
emojis: [updated],
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.globalEventService.publishBroadcastStream('emojiDeleted', {
|
this.globalEventService.publishBroadcastStream('emojiDeleted', {
|
||||||
emojis: [ await this.emojiEntityService.pack(emoji) ],
|
emojis: [await this.emojiEntityService.pack(emoji)],
|
||||||
});
|
});
|
||||||
|
|
||||||
this.globalEventService.publishBroadcastStream('emojiAdded', {
|
this.globalEventService.publishBroadcastStream('emojiAdded', {
|
||||||
|
|
|
@ -280,7 +280,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
files: files,
|
files: files,
|
||||||
poll: ps.poll ? {
|
poll: ps.poll ? {
|
||||||
choices: ps.poll.choices,
|
choices: ps.poll.choices,
|
||||||
multiple: ps.poll.multiple || false,
|
multiple: ps.poll.multiple ?? false,
|
||||||
expiresAt: ps.poll.expiresAt ? new Date(ps.poll.expiresAt) : null,
|
expiresAt: ps.poll.expiresAt ? new Date(ps.poll.expiresAt) : null,
|
||||||
} : undefined,
|
} : undefined,
|
||||||
text: ps.text ?? undefined,
|
text: ps.text ?? undefined,
|
||||||
|
|
Loading…
Reference in a new issue