From e009b9b2b6538b0e842763bd0ab2473a836e884b Mon Sep 17 00:00:00 2001 From: Andcool-Systems Date: Sun, 5 Jan 2025 02:13:47 +0300 Subject: [PATCH] API changes --- src/app/workshop/[id]/bandage_engine.ts | 18 +++++++----------- src/app/workshop/[id]/components/skinLoad.tsx | 6 +++--- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/app/workshop/[id]/bandage_engine.ts b/src/app/workshop/[id]/bandage_engine.ts index 65165e6..534ddf6 100644 --- a/src/app/workshop/[id]/bandage_engine.ts +++ b/src/app/workshop/[id]/bandage_engine.ts @@ -2,13 +2,9 @@ import asyncImage, { base64Encode } from '@/app/modules/utils/asyncImage'; import ApiManager from '@/app/modules/utils/apiManager'; export interface SkinResponse { - data: { - skin: { - data: string, - slim: boolean - }, - cape: string - } + skin: string, + cape: string, + slim: boolean } export const b64Prefix = "data:image/png;base64,"; @@ -79,11 +75,11 @@ class Client { if (!nickname) return; const data = await ApiManager.getSkin(nickname); - this.slim = data.data.skin.slim; + this.slim = data.slim; - this.setOriginalCanvas(b64Prefix + data.data.skin.data, () => { - this.skin = b64Prefix + data.data.skin; - this.cape = b64Prefix + data.data.cape; + this.setOriginalCanvas(b64Prefix + data.skin, () => { + this.skin = b64Prefix + data.skin; + this.cape = b64Prefix + data.cape; this.rerender(); }); diff --git a/src/app/workshop/[id]/components/skinLoad.tsx b/src/app/workshop/[id]/components/skinLoad.tsx index 3f12234..8eb62c6 100644 --- a/src/app/workshop/[id]/components/skinLoad.tsx +++ b/src/app/workshop/[id]/components/skinLoad.tsx @@ -40,9 +40,9 @@ const SkinLoad = ({ expanded, onChange }: SkinLoadProps) => { ApiManager.getSkin(nickname) .then(data => { setData({ - data: b64Prefix + data.data.skin.data, - slim: data.data.skin.slim, - cape: data.data.cape + data: b64Prefix + data.skin, + slim: data.slim, + cape: data.cape }); setLoaded(true); })