fix(api): 🐛 Properly include global field in API emojis

This commit is contained in:
Jesse Wierzbinski 2024-11-29 21:49:41 +01:00
parent 46933c1bef
commit ca42df1dfd
No known key found for this signature in database
3 changed files with 4 additions and 3 deletions

BIN
bun.lockb

Binary file not shown.

View file

@ -1,6 +1,6 @@
import { emojiValidatorWithColons, emojiValidatorWithIdentifiers } from "@/api";
import { proxyUrl } from "@/response";
import type { Emoji as ApiEmoji } from "@versia/client/types";
import type { Emoji as APIEmoji } from "@versia/client/types";
import type { CustomEmojiExtension } from "@versia/federation/types";
import { db } from "@versia/kit/db";
import { Emojis, Instances } from "@versia/kit/tables";
@ -187,7 +187,7 @@ export class Emoji extends BaseInterface<typeof Emojis, EmojiWithInstance> {
);
}
public toApi(): ApiEmoji & { id: string } {
public toApi(): APIEmoji {
return {
id: this.id,
shortcode: this.data.shortcode,
@ -195,6 +195,7 @@ export class Emoji extends BaseInterface<typeof Emojis, EmojiWithInstance> {
url: proxyUrl(this.data.url) ?? "",
visible_in_picker: this.data.visibleInPicker,
category: this.data.category ?? undefined,
global: this.data.ownerId === null,
};
}

View file

@ -122,7 +122,7 @@
"@oclif/core": "^4.0.33",
"@sentry/bun": "^8.41.0",
"@tufjs/canonical-json": "^2.0.0",
"@versia/client": "^0.1.1",
"@versia/client": "^0.1.2",
"@versia/federation": "^0.1.4",
"@versia/kit": "workspace:*",
"altcha-lib": "^1.1.1",