mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
Add nest endpoints and pages
This commit is contained in:
20
resources/scripts/api/admin/nests/getNests.ts
Normal file
20
resources/scripts/api/admin/nests/getNests.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import http from '@/api/http';
|
||||
import { rawDataToNest } from '@/api/transformers';
|
||||
|
||||
export interface Nest {
|
||||
id: number;
|
||||
uuid: string;
|
||||
author: string;
|
||||
name: string;
|
||||
description: string | null;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export default (): Promise<Nest[]> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.get('/api/application/nests')
|
||||
.then(({ data }) => resolve((data.data || []).map(rawDataToNest)))
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user