summary refs log tree commit diff
path: root/src/api/routes/applications/#id/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/routes/applications/#id/index.ts')
-rw-r--r--src/api/routes/applications/#id/index.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/api/routes/applications/#id/index.ts b/src/api/routes/applications/#id/index.ts
index c372869a..949d66f8 100644
--- a/src/api/routes/applications/#id/index.ts
+++ b/src/api/routes/applications/#id/index.ts
@@ -21,6 +21,7 @@ import {
 	Application,
 	ApplicationModifySchema,
 	DiscordApiErrors,
+	handleFile,
 } from "@spacebar/util";
 import { Request, Response, Router } from "express";
 import { HTTPError } from "lambert-server";
@@ -83,6 +84,13 @@ router.patch(
 		)
 			throw new HTTPError(req.t("auth:login.INVALID_TOTP_CODE"), 60008);
 
+		if (body.icon) {
+			body.icon = await handleFile(
+				`/app-icons/${app.id}`,
+				body.icon as string,
+			);
+		}
+
 		if (app.bot) {
 			app.bot.assign({ bio: body.description });
 			await app.bot.save();