diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index 5b2494bbd..1ea4f15e2 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -4,6 +4,7 @@ import { BASE_URL_API } from "../../constants/constants"; import { api } from "../../controllers/API/api"; import { APIObjectType, + Component, LoginType, Users, changeUser, @@ -661,6 +662,18 @@ export async function getStoreComponents({ } } +export async function postStoreComponents(component: Component) { + try { + const res = await api.post(`${BASE_URL_API}store/components/`, component); + if (res.status === 200) { + return res.data; + } + } catch (error) { + console.log("Error:", error); + throw error; + } +} + export async function getComponent(component_id: string) { try { const res = await api.get(