Skip to content

Commit

Permalink
update proto api (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
dogfrogfog authored Jul 10, 2024
1 parent b696656 commit 549a1eb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion proto
4 changes: 2 additions & 2 deletions src/api/proto-http/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ export type ProductInsert = {
};

export type ProductBody = {
preorder: string | undefined;
preorder: wellKnownTimestamp | undefined;
name: string | undefined;
brand: string | undefined;
sku: string | undefined;
Expand Down Expand Up @@ -450,7 +450,7 @@ export type Product = {

export type ProductDisplay = {
productBody: ProductBody | undefined;
thumbnail: MediaItem | undefined;
thumbnail: MediaFull | undefined;
};

export type ProductSize = {
Expand Down
24 changes: 18 additions & 6 deletions src/api/proto-http/frontend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ export type common_Product = {

export type common_ProductDisplay = {
productBody: common_ProductBody | undefined;
thumbnail: common_MediaItem | undefined;
thumbnail: common_MediaFull | undefined;
};

export type common_ProductBody = {
preorder: string | undefined;
preorder: wellKnownTimestamp | undefined;
name: string | undefined;
brand: string | undefined;
sku: string | undefined;
Expand Down Expand Up @@ -294,7 +294,10 @@ export type common_CurrencyRate = {
};

export type GetProductRequest = {
slug: string | undefined;
gender: string | undefined;
brand: string | undefined;
name: string | undefined;
id: number | undefined;
};

export type GetProductResponse = {
Expand Down Expand Up @@ -691,10 +694,19 @@ export function createFrontendServiceClient(
}) as Promise<GetHeroResponse>;
},
GetProduct(request) { // eslint-disable-line @typescript-eslint/no-unused-vars
if (!request.slug) {
throw new Error("missing required field request.slug");
if (!request.gender) {
throw new Error("missing required field request.gender");
}
if (!request.brand) {
throw new Error("missing required field request.brand");
}
if (!request.name) {
throw new Error("missing required field request.name");
}
if (!request.id) {
throw new Error("missing required field request.id");
}
const path = `api/frontend/product/${request.slug}`; // eslint-disable-line quotes
const path = `api/frontend/product/${request.gender}/${request.brand}/${request.name}/${request.id}`; // eslint-disable-line quotes
const body = null;
const queryParams: string[] = [];
let uri = path;
Expand Down

0 comments on commit 549a1eb

Please sign in to comment.