Skip to content

Commit 023f534

Browse files
committed
feat(server): Add ProductApi class to handle product-related API calls
1 parent e7df392 commit 023f534

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/server/ProductApi.tsx

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import {HttpClient} from "@/server/Client";
2+
import {DataProductPostParam} from "@/server/types";
3+
4+
export class ProductApi extends HttpClient {
5+
async Post(owner: string, repo: string, param: DataProductPostParam) {
6+
return await this.post<string>(`/product/${owner}/${repo}/post`, param)
7+
}
8+
async List(limit: number, page: number, order: string, search?: string) {
9+
return await this.post<string>(`/product/list`, {
10+
limit: limit,
11+
page: page,
12+
order: order,
13+
search: search
14+
})
15+
}
16+
}

0 commit comments

Comments
 (0)