docs: fix mock error (#40436)

This commit is contained in:
聪小陈 2023-01-29 12:29:21 +08:00 committed by GitHub
parent 08a457c60e
commit a8f9d1af61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -180,9 +180,11 @@ let products: Product[] = [
];
export default defineMock({
'GET /api/products': {
status: 'ok',
data: products,
'GET /api/products': (_, res) => {
res.send({
status: 'ok',
data: products,
});
},
'DELETE /api/products/:id': (req, res) => {
products = products.filter((item) => item.id !== req.params.id);

View File

@ -180,9 +180,11 @@ let products: Product[] = [
];
export default defineMock({
'GET /api/products': {
status: 'ok',
data: products,
'GET /api/products': (_, res) => {
res.send({
status: 'ok',
data: products,
});
},
'DELETE /api/products/:id': (req, res) => {
products = products.filter((item) => item.id !== req.params.id);