updated docs
This commit is contained in:
0
web_services/web-controllers/hooks/a.txt
Normal file
0
web_services/web-controllers/hooks/a.txt
Normal file
29
web_services/web-controllers/hooks/application/hook.tsx
Normal file
29
web_services/web-controllers/hooks/application/hook.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
export async function retrieveAvailableApplications(data: any): Promise<string[]> {
|
||||
try {
|
||||
const response = await fetch("http://localhost:3000/api/menu", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", "no-cache": "true" },
|
||||
body: JSON.stringify({ ...data }),
|
||||
})
|
||||
if (response.status !== 200) {
|
||||
throw new Error("Failed to retrieve available applications");
|
||||
}
|
||||
const result = await response.json();
|
||||
return result.data
|
||||
} catch (error) { throw error }
|
||||
}
|
||||
|
||||
export async function retrievePageToRender(data: any): Promise<string> {
|
||||
try {
|
||||
const response = await fetch("http://localhost:3000/api/pages", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json", "no-cache": "true" },
|
||||
body: JSON.stringify({ ...data }),
|
||||
})
|
||||
if (response.status !== 200) {
|
||||
throw new Error("Failed to retrieve page to render");
|
||||
}
|
||||
const result = await response.json();
|
||||
return result.data
|
||||
} catch (error) { throw error }
|
||||
}
|
||||
Reference in New Issue
Block a user