feat: improve design
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -16,7 +16,8 @@ export async function fetchModules(): Promise<Module[]> {
|
||||
}
|
||||
|
||||
const data = await response.json()
|
||||
return data.modules || []
|
||||
const raw = data.modules || {}
|
||||
return Array.isArray(raw) ? raw : Object.values(raw)
|
||||
}
|
||||
|
||||
export async function manageModule(handle: string, action: ModuleAction): Promise<{ message?: string; error?: string }> {
|
||||
|
||||
Reference in New Issue
Block a user