Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: api.ts Change the parameter passing method #10903

Merged
merged 1 commit into from
Aug 26, 2023
Merged

fix: api.ts Change the parameter passing method #10903

merged 1 commit into from
Aug 26, 2023

Conversation

zhangrenyang
Copy link
Contributor

Currently, the query table throws an error during modification and deletion. When adding new entries, the parameters also cannot be passed correctly.
Based on the definition in mock\listTableList.ts, the method of passing request parameters needs to be changed.

function postRule(req: Request, res: Response, u: string, b: Request) {
  const body = (b && b.body) || req.body;
  const { method, name, desc, key } = body;
  switch (method) {
    case 'delete':
      break;
    case 'post':
      return;
    case 'update':
      return;
    default:
      break;
  }
}
export default {
  'GET /api/rule': getRule,
  'POST /api/rule': postRule,
};

deleteRule
updateRUle

@github-actions
Copy link

⚡️ Deploying PR Preview...

@chenshuai2144 chenshuai2144 merged commit 6ba66b8 into ant-design:master Aug 26, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants