summary refs log tree commit diff
path: root/util/src
diff options
context:
space:
mode:
Diffstat (limited to 'util/src')
-rw-r--r--util/src/entities/ReadState.ts5
-rw-r--r--util/src/entities/index.ts1
-rw-r--r--util/src/util/cdn.ts4
3 files changed, 4 insertions, 6 deletions
diff --git a/util/src/entities/ReadState.ts b/util/src/entities/ReadState.ts
index 89480e83..ebef89be 100644
--- a/util/src/entities/ReadState.ts
+++ b/util/src/entities/ReadState.ts
@@ -32,13 +32,8 @@ export class ReadState extends BaseClass {
 	user: User;
 
 	@Column({ nullable: true })
-	@RelationId((read_state: ReadState) => read_state.last_message)
 	last_message_id: string;
 
-	@JoinColumn({ name: "last_message_id" })
-	@ManyToOne(() => Message, { nullable: true })
-	last_message?: Message;
-
 	@Column({ nullable: true })
 	last_pin_timestamp?: Date;
 
diff --git a/util/src/entities/index.ts b/util/src/entities/index.ts
index 7b1c9750..31afed88 100644
--- a/util/src/entities/index.ts
+++ b/util/src/entities/index.ts
@@ -18,6 +18,7 @@ export * from "./Relationship";
 export * from "./Role";
 export * from "./Session";
 export * from "./Sticker";
+export * from "./StickerPack";
 export * from "./Team";
 export * from "./TeamMember";
 export * from "./Template";
diff --git a/util/src/util/cdn.ts b/util/src/util/cdn.ts
index 4dd0078a..ea950cd1 100644
--- a/util/src/util/cdn.ts
+++ b/util/src/util/cdn.ts
@@ -4,7 +4,9 @@ import fetch from "node-fetch";
 import { Config } from "./Config";
 import multer from "multer";
 
-export async function uploadFile(path: string, file: Express.Multer.File) {
+export async function uploadFile(path: string, file?: Express.Multer.File) {
+	if (!file?.buffer) throw new HTTPError("Missing file in body");
+
 	const form = new FormData();
 	form.append("file", file.buffer, {
 		contentType: file.mimetype,