Skip to content

Commit

Permalink
name is required
Browse files Browse the repository at this point in the history
  • Loading branch information
runely committed Jun 10, 2022
1 parent 633626e commit 7d0c723
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mocks/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ export const handlers = [
)
}),
rest.post(`${API.URL}/apikeys`, (req, res, ctx) => {
if (!req.body?.name) {
return res(
ctx.status(400),
ctx.json({ message: 'Error: name cannot be empty' })
)
}

const { fullitem } = getReqSearchParams(req)
const apiKeys = get({ top: getTop(req), type: 'apikeys' })
const copyApiKey = apiKeys.data.length > 0 ? apiKeys.data[0] : _apikeys[0]
Expand Down

0 comments on commit 7d0c723

Please sign in to comment.