ui(admin): add "working" React admin ui
This commit is contained in:
parent
d1c7494933
commit
5402584508
199 changed files with 13387 additions and 151 deletions
25
resources/scripts/api/admin/nest.ts
Normal file
25
resources/scripts/api/admin/nest.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { Model, UUID } from '@/api/admin/index';
|
||||
import { Egg } from '@/api/admin/egg';
|
||||
import http, { QueryBuilderParams, withQueryBuilderParams } from '@/api/http';
|
||||
import { Transformers } from '@definitions/admin';
|
||||
|
||||
export interface Nest extends Model {
|
||||
id: number;
|
||||
uuid: UUID;
|
||||
author: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
relationships: {
|
||||
eggs?: Egg[];
|
||||
};
|
||||
}
|
||||
|
||||
export const searchNests = async (params: QueryBuilderParams<'name'>): Promise<Nest[]> => {
|
||||
const { data } = await http.get('/api/application/nests', {
|
||||
params: withQueryBuilderParams(params),
|
||||
});
|
||||
|
||||
return data.data.map(Transformers.toNest);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue