feat: product images upload and display
This commit is contained in:
@ -51,6 +51,13 @@ export const zBoardSchema = z.object({
|
||||
projectId: z.int(),
|
||||
});
|
||||
|
||||
/**
|
||||
* Body_upload_product_image
|
||||
*/
|
||||
export const zBodyUploadProductImage = z.object({
|
||||
upload_file: z.any(),
|
||||
});
|
||||
|
||||
/**
|
||||
* BuiltInModuleTabSchema
|
||||
*/
|
||||
@ -234,6 +241,15 @@ export const zCreateDealProductRequest = z.object({
|
||||
entity: zCreateDealProductSchema,
|
||||
});
|
||||
|
||||
/**
|
||||
* ProductImageSchema
|
||||
*/
|
||||
export const zProductImageSchema = z.object({
|
||||
id: z.int(),
|
||||
productId: z.int(),
|
||||
imageUrl: z.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* ProductSchema
|
||||
*/
|
||||
@ -249,6 +265,8 @@ export const zProductSchema = z.object({
|
||||
size: z.union([z.string(), z.null()]),
|
||||
additionalInfo: z.union([z.string(), z.null()]),
|
||||
barcodes: z.array(z.string()),
|
||||
imageUrl: z.optional(z.union([z.string(), z.null()])),
|
||||
images: z.optional(z.union([z.array(zProductImageSchema), z.null()])),
|
||||
id: z.int(),
|
||||
barcodeTemplate: zBarcodeTemplateSchema,
|
||||
});
|
||||
@ -509,6 +527,8 @@ export const zCreateProductSchema = z.object({
|
||||
size: z.union([z.string(), z.null()]),
|
||||
additionalInfo: z.union([z.string(), z.null()]),
|
||||
barcodes: z.array(z.string()),
|
||||
imageUrl: z.optional(z.union([z.string(), z.null()])),
|
||||
images: z.optional(z.union([z.array(zProductImageSchema), z.null()])),
|
||||
});
|
||||
|
||||
/**
|
||||
@ -957,13 +977,6 @@ export const zGetProductsResponse = z.object({
|
||||
paginationInfo: zPaginationInfoSchema,
|
||||
});
|
||||
|
||||
/**
|
||||
* GetProjectResponse
|
||||
*/
|
||||
export const zGetProjectResponse = z.object({
|
||||
entity: zProjectSchema,
|
||||
});
|
||||
|
||||
/**
|
||||
* GetProjectsResponse
|
||||
*/
|
||||
@ -1042,15 +1055,6 @@ export const zHttpValidationError = z.object({
|
||||
detail: z.optional(z.array(zValidationError)),
|
||||
});
|
||||
|
||||
/**
|
||||
* ProductImageSchema
|
||||
*/
|
||||
export const zProductImageSchema = z.object({
|
||||
id: z.int(),
|
||||
productId: z.int(),
|
||||
imageUrl: z.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* ProductServicesDuplicateRequest
|
||||
*/
|
||||
@ -1067,6 +1071,14 @@ export const zProductServicesDuplicateResponse = z.object({
|
||||
message: z.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* ProductUploadImageResponse
|
||||
*/
|
||||
export const zProductUploadImageResponse = z.object({
|
||||
message: z.string(),
|
||||
imageUrl: z.optional(z.union([z.string(), z.null()])),
|
||||
});
|
||||
|
||||
export const zSortDir = z.enum(["asc", "desc"]);
|
||||
|
||||
/**
|
||||
@ -2146,6 +2158,19 @@ export const zUpdateProductData = z.object({
|
||||
*/
|
||||
export const zUpdateProductResponse2 = zUpdateProductResponse;
|
||||
|
||||
export const zUploadProductImageData = z.object({
|
||||
body: zBodyUploadProductImage,
|
||||
path: z.object({
|
||||
productId: z.int(),
|
||||
}),
|
||||
query: z.optional(z.never()),
|
||||
});
|
||||
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
export const zUploadProductImageResponse = zProductUploadImageResponse;
|
||||
|
||||
export const zGetProductBarcodePdfData = z.object({
|
||||
body: zGetProductBarcodePdfRequest,
|
||||
path: z.optional(z.never()),
|
||||
@ -2336,19 +2361,6 @@ export const zDeleteProjectData = z.object({
|
||||
*/
|
||||
export const zDeleteProjectResponse2 = zDeleteProjectResponse;
|
||||
|
||||
export const zGetProjectData = z.object({
|
||||
body: z.optional(z.never()),
|
||||
path: z.object({
|
||||
pk: z.int(),
|
||||
}),
|
||||
query: z.optional(z.never()),
|
||||
});
|
||||
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
export const zGetProjectResponse2 = zGetProjectResponse;
|
||||
|
||||
export const zUpdateProjectData = z.object({
|
||||
body: zUpdateProjectRequest,
|
||||
path: z.object({
|
||||
|
||||
Reference in New Issue
Block a user