2024-07-24 23:20:59 +03:00
|
|
|
/**
|
|
|
|
* Endpoints: oss.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import {
|
2024-07-28 00:37:50 +03:00
|
|
|
IInputCreatedResponse,
|
2024-07-24 23:20:59 +03:00
|
|
|
IOperationCreateData,
|
|
|
|
IOperationCreatedResponse,
|
|
|
|
IOperationSchemaData,
|
|
|
|
IPositionsData,
|
|
|
|
ITargetOperation
|
|
|
|
} from '@/models/oss';
|
|
|
|
|
|
|
|
import { AxiosGet, AxiosPatch, AxiosPost, FrontExchange, FrontPull, FrontPush } from './apiTransport';
|
|
|
|
|
|
|
|
export function getOssDetails(target: string, request: FrontPull<IOperationSchemaData>) {
|
|
|
|
AxiosGet({
|
|
|
|
endpoint: `/api/oss/${target}/details`,
|
|
|
|
request: request
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-07-28 00:37:50 +03:00
|
|
|
export function patchUpdatePositions(oss: string, request: FrontPush<IPositionsData>) {
|
2024-07-24 23:20:59 +03:00
|
|
|
AxiosPatch({
|
2024-07-28 00:37:50 +03:00
|
|
|
endpoint: `/api/oss/${oss}/update-positions`,
|
2024-07-24 23:20:59 +03:00
|
|
|
request: request
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export function postCreateOperation(
|
2024-07-28 00:37:50 +03:00
|
|
|
oss: string,
|
2024-07-24 23:20:59 +03:00
|
|
|
request: FrontExchange<IOperationCreateData, IOperationCreatedResponse>
|
|
|
|
) {
|
|
|
|
AxiosPost({
|
2024-07-28 00:37:50 +03:00
|
|
|
endpoint: `/api/oss/${oss}/create-operation`,
|
2024-07-24 23:20:59 +03:00
|
|
|
request: request
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-07-28 00:37:50 +03:00
|
|
|
export function patchDeleteOperation(oss: string, request: FrontExchange<ITargetOperation, IOperationSchemaData>) {
|
2024-07-24 23:20:59 +03:00
|
|
|
AxiosPatch({
|
2024-07-28 00:37:50 +03:00
|
|
|
endpoint: `/api/oss/${oss}/delete-operation`,
|
|
|
|
request: request
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export function patchCreateInput(oss: string, request: FrontExchange<ITargetOperation, IInputCreatedResponse>) {
|
|
|
|
AxiosPatch({
|
|
|
|
endpoint: `/api/oss/${oss}/create-input`,
|
2024-07-24 23:20:59 +03:00
|
|
|
request: request
|
|
|
|
});
|
|
|
|
}
|