-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mocks): re-add zone HTTP endpoint (#3087)
In #3034 we cleaned up a few mock endpoints we don't use. We mistakenly removed the zone deletion endpoint, which we use elsewhere but the backend code for it is in the kuma binary and as such this mock belongs here. Signed-off-by: John Cowen <john.cowen@konghq.com>
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { EndpointDependencies, MockResponder } from '@/test-support' | ||
|
||
export default (_deps: EndpointDependencies): MockResponder => (req) => { | ||
switch (req.method.toUpperCase()) { | ||
case 'DELETE': | ||
return { | ||
headers: {}, | ||
body: {}, | ||
} | ||
default: | ||
return { | ||
headers: {}, | ||
body: { | ||
type: 'Zone', | ||
name: req.params.name, | ||
creationTime: '2021-02-19T08:06:15.380674+01:00', | ||
modificationTime: '2021-02-19T08:06:15.380674+01:00', | ||
enabled: true, | ||
}, | ||
} | ||
} | ||
} |