Merge pull request 'fear: change requests to RTK query' (#78) from feature/rtk-query-arm into main
All checks were successful
it-academy/dry-wash-pl/pipeline/head This commit looks good
All checks were successful
it-academy/dry-wash-pl/pipeline/head This commit looks good
Reviewed-on: #78 Reviewed-by: Primakov Alexandr Alexandrovich <primakovpro@gmail.com>
This commit was merged in pull request #78.
This commit is contained in:
@@ -12,4 +12,4 @@ type ErrorResponse = {
|
||||
message: ErrorMessage;
|
||||
};
|
||||
|
||||
export type BaseResponse<Body> = SuccessResponse<Body> | ErrorResponse;
|
||||
export type BaseResponse<Body> = SuccessResponse<Body> | ErrorResponse;
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from './common';
|
||||
export * from './order';
|
||||
export * from './order';
|
||||
export * from './master';
|
||||
|
||||
@@ -1,21 +1,49 @@
|
||||
/* eslint-disable @typescript-eslint/no-namespace */
|
||||
import { Order } from "../landing";
|
||||
import { Order } from '../landing';
|
||||
|
||||
import { ErrorMessage } from "./common";
|
||||
import { ErrorMessage } from './common';
|
||||
import { Master } from './master';
|
||||
|
||||
export namespace GetOrder {
|
||||
export type Response = Order.View;
|
||||
export type Params = {
|
||||
orderId: Order.Id
|
||||
orderId: Order.Id;
|
||||
};
|
||||
export type Error = ErrorMessage;
|
||||
}
|
||||
|
||||
export namespace CreateOrder {
|
||||
export type Response = {
|
||||
id: Order.Id
|
||||
id: Order.Id;
|
||||
};
|
||||
export type Params = {
|
||||
body: Order.Create
|
||||
body: Order.Create;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
type GetArrItemType<ArrType> =
|
||||
ArrType extends Array<infer ItemType> ? ItemType : never;
|
||||
|
||||
export const statuses = [
|
||||
'pending' as const,
|
||||
'progress' as const,
|
||||
'working' as const,
|
||||
'canceled' as const,
|
||||
'complete' as const,
|
||||
];
|
||||
|
||||
export type Status = (typeof statuses)[number];
|
||||
|
||||
export type OrderArm = {
|
||||
carNumber?: string;
|
||||
startWashTime?: string;
|
||||
endWashTime?: string;
|
||||
orderDate?: string;
|
||||
status?: GetArrItemType<typeof statuses>;
|
||||
phone?: string;
|
||||
location?: string;
|
||||
master: Master;
|
||||
notes: '';
|
||||
allMasters: Master[];
|
||||
id: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user