Skip to content

Commit

Permalink
add delete endpoint for fact sources (#2257)
Browse files Browse the repository at this point in the history
  • Loading branch information
bleepbop authored Sep 17, 2021
1 parent ca0304d commit 7974427
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/api/v2/handlers/fact_source_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def add_routes(self, app: web.Application):
router.add_post('/sources', self.create_fact_source)
router.add_patch('/sources/{id}', self.update_fact_source)
router.add_put('/sources/{id}', self.create_or_update_source)
router.add_delete('/sources/{id}', self.delete_source)

@aiohttp_apispec.docs(tags=['sources'])
@aiohttp_apispec.querystring_schema(BaseGetAllQuerySchema)
Expand Down Expand Up @@ -55,3 +56,9 @@ async def update_fact_source(self, request: web.Request):
async def create_or_update_source(self, request: web.Request):
source = await self.create_or_update_on_disk_object(request)
return web.json_response(source.display)

@aiohttp_apispec.docs(tags=['sources'])
@aiohttp_apispec.response_schema(SourceSchema)
async def delete_source(self, request: web.Request):
await self.delete_object(request)
return web.HTTPNoContent()

0 comments on commit 7974427

Please sign in to comment.