Initial commit
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
import { HttpRequestClient } from '@/utils/request';
|
||||
import type { BehaviorTree, BehaviorTreeDetailsResponse, BehaviorTreePageResponse, NodeTemplatesResponse, TreeModelDetailsResponse, TreeModelGraph } from './types';
|
||||
import type { BehaviorTree, BehaviorTreeDetailsResponse, BehaviorTreePageResponse, NodeTemplatesResponse } from './types';
|
||||
import type { BasicResponse } from '@/types';
|
||||
|
||||
const req = HttpRequestClient.create<BasicResponse>({
|
||||
@@ -23,17 +23,17 @@ export const findTreesByQuery = (query: Partial<BehaviorTree> = {}): Promise<Beh
|
||||
return req.get<BehaviorTreePageResponse>('/system/behaviortree/list', query);
|
||||
};
|
||||
|
||||
|
||||
export const findOneTreeById = (id: number): Promise<BehaviorTreeDetailsResponse> => {
|
||||
return req.get(`/system/behaviortree/${id}`);
|
||||
};
|
||||
|
||||
export const updateTree = (rt: Partial<TreeModelGraph>): Promise<BasicResponse> => {
|
||||
return req.postJson('/behavior-trees', rt);
|
||||
|
||||
export const updateTree = (rt: Partial<BehaviorTree>): Promise<BasicResponse> => {
|
||||
return req.postJson('/system/behaviortree/${id}', rt);
|
||||
};
|
||||
|
||||
export const createTree = (rt: Partial<TreeModelGraph>): Promise<BasicResponse> => {
|
||||
return req.putJson('/behavior-trees', rt);
|
||||
export const createTree = (rt: Partial<BehaviorTree>): Promise<BasicResponse> => {
|
||||
return req.putJson('/system/behaviortree/${id}', rt);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user