Skip to content

Commit

Permalink
website: quick start update genRoute part
Browse files Browse the repository at this point in the history
  • Loading branch information
suhaotian committed Jan 4, 2024
1 parent 8bfcdac commit 17794dc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion website/components/home.en-US/code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import { Tabs } from 'nextra-theme-docs';
export function setupHelloAPI() {
genRoute<GetHelloReq, GetHelloRes>(
GetHelloConfig,
async (reqInfo: Readonly<RequestInfo>, data) => {
async (data, reqInfo: Readonly<RequestInfo>) => {
return { result: `Hello ${data.world}` };
}
);
Expand Down
2 changes: 1 addition & 1 deletion website/components/home.zh-CN/code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import { Tabs } from 'nextra-theme-docs';
export function setupHelloAPI() {
genRoute<GetHelloReq, GetHelloRes>(
GetHelloConfig,
async (reqInfo: Readonly<RequestInfo>, data) => {
async (data, reqInfo: Readonly<RequestInfo>) => {
return { result: `Hello ${data.world}` };
}
);
Expand Down
4 changes: 2 additions & 2 deletions website/pages/docs/quick-start/hello-world-api.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,14 @@ const DB = {
export function setupHelloAPI() {
genRoute<GetHelloReq, GetHelloRes>(
GetHelloConfig,
async (reqInfo: Readonly<RequestInfo>, data) => {
async (data, reqInfo: Readonly<RequestInfo>) => {
return { result: DB.data };
}
);

genRoute<UpdateHelloReq, UpdateHelloRes>(
UpdateHelloConfig,
async (reqInfo: Readonly<RequestInfo>, data) => {
async (data, reqInfo: Readonly<RequestInfo>) => {
DB.data = data.payload;
return { result: data.payload };
}
Expand Down
4 changes: 2 additions & 2 deletions website/pages/docs/quick-start/hello-world-api.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,14 @@ const DB = {
export function setupHelloAPI() {
genRoute<GetHelloReq, GetHelloRes>(
GetHelloConfig,
async (reqInfo: Readonly<RequestInfo>, data) => {
async (data, reqInfo: Readonly<RequestInfo>) => {
return { result: DB.data };
}
);

genRoute<UpdateHelloReq, UpdateHelloRes>(
UpdateHelloConfig,
async (reqInfo: Readonly<RequestInfo>, data) => {
async (data, reqInfo: Readonly<RequestInfo>) => {
DB.data = data.payload;
return { result: data.payload };
}
Expand Down

0 comments on commit 17794dc

Please sign in to comment.