diff --git a/resources/scripts/api/admin/egg.ts b/resources/scripts/api/admin/egg.ts index 74046894..fb7e52ed 100644 --- a/resources/scripts/api/admin/egg.ts +++ b/resources/scripts/api/admin/egg.ts @@ -51,18 +51,18 @@ export interface EggVariable extends Model { export const getEgg = async (id: number | string): Promise> => { const { data } = await http.get(`/api/application/eggs/${id}`, { params: { - includes: [ 'nest', 'variables' ], + include: [ 'nest', 'variables' ], }, }); - return withRelationships(AdminTransformers.toEgg(data.data), 'nest', 'variables'); + return withRelationships(AdminTransformers.toEgg(data), 'nest', 'variables'); }; export const searchEggs = async (nestId: number, params: QueryBuilderParams<'name'>): Promise[]> => { const { data } = await http.get(`/api/application/nests/${nestId}/eggs`, { params: { ...withQueryBuilderParams(params), - includes: [ 'variables' ], + include: [ 'variables' ], }, }); diff --git a/resources/scripts/api/admin/node.ts b/resources/scripts/api/admin/node.ts index 9ae6678a..3320e746 100644 --- a/resources/scripts/api/admin/node.ts +++ b/resources/scripts/api/admin/node.ts @@ -60,7 +60,7 @@ export interface Node extends Model { export const getNode = async (id: string | number): Promise> => { const { data } = await http.get(`/api/application/nodes/${id}`, { params: { - includes: [ 'location' ], + include: [ 'location' ], }, }); diff --git a/resources/scripts/api/admin/server.ts b/resources/scripts/api/admin/server.ts index 4a0112c4..36817554 100644 --- a/resources/scripts/api/admin/server.ts +++ b/resources/scripts/api/admin/server.ts @@ -79,7 +79,7 @@ type LoadedServer = WithRelationships; export const getServer = async (id: number | string): Promise => { const { data } = await http.get(`/api/application/servers/${id}`, { params: { - includes: [ 'allocations', 'user', 'node' ], + include: [ 'allocations', 'user', 'node' ], }, }); diff --git a/resources/scripts/api/admin/transformers.ts b/resources/scripts/api/admin/transformers.ts index 6447bb04..b306a41c 100644 --- a/resources/scripts/api/admin/transformers.ts +++ b/resources/scripts/api/admin/transformers.ts @@ -88,7 +88,7 @@ export class AdminTransformers { createdAt: new Date(attributes.created_at), updatedAt: new Date(attributes.updated_at), relationships: { - location: transform(attributes.relationships!.location as FractalResponseData, this.toLocation), + location: transform(attributes.relationships?.location as FractalResponseData, this.toLocation), }, }; };