File tree Expand file tree Collapse file tree 3 files changed +71
-60
lines changed
Expand file tree Collapse file tree 3 files changed +71
-60
lines changed Original file line number Diff line number Diff line change 650650 }
651651 ]
652652 }
653+ },
654+ "/systems/{inventory_id}" : {
655+ "delete" : {
656+ "summary" : " Delete system by inventory id" ,
657+ "description" : " Delete system by inventory id" ,
658+ "operationId" : " deletesystem" ,
659+ "parameters" : [
660+ {
661+ "name" : " inventory_id" ,
662+ "in" : " path" ,
663+ "description" : " Inventory ID" ,
664+ "required" : true ,
665+ "schema" : {
666+ "type" : " string"
667+ }
668+ },
669+ {
670+ "name" : " rh_account_id" ,
671+ "in" : " query" ,
672+ "description" : " Account ID" ,
673+ "required" : true ,
674+ "schema" : {
675+ "type" : " string"
676+ }
677+ }
678+ ],
679+ "responses" : {
680+ "200" : {
681+ "description" : " OK" ,
682+ "content" : {}
683+ },
684+ "400" : {
685+ "description" : " Bad Request" ,
686+ "content" : {
687+ "application/json" : {
688+ "schema" : {
689+ "type" : " string"
690+ }
691+ }
692+ }
693+ },
694+ "404" : {
695+ "description" : " Not Found" ,
696+ "content" : {
697+ "application/json" : {
698+ "schema" : {
699+ "type" : " string"
700+ }
701+ }
702+ }
703+ },
704+ "500" : {
705+ "description" : " Internal Server Error" ,
706+ "content" : {
707+ "application/json" : {
708+ "schema" : {
709+ "type" : " string"
710+ }
711+ }
712+ }
713+ }
714+ },
715+ "security" : [
716+ {
717+ "RhIdentity" : []
718+ }
719+ ]
720+ }
653721 }
654722 },
655723 "components" : {
Original file line number Diff line number Diff line change 46994699 "RhIdentity" : []
47004700 }
47014701 ]
4702- },
4703- "delete" : {
4704- "summary" : " Delete system by inventory id" ,
4705- "description" : " Delete system by inventory id" ,
4706- "operationId" : " deletesystem" ,
4707- "parameters" : [
4708- {
4709- "name" : " inventory_id" ,
4710- "in" : " path" ,
4711- "description" : " Inventory ID" ,
4712- "required" : true ,
4713- "schema" : {
4714- "type" : " string"
4715- }
4716- }
4717- ],
4718- "responses" : {
4719- "200" : {
4720- "description" : " OK" ,
4721- "content" : {}
4722- },
4723- "400" : {
4724- "description" : " Bad Request" ,
4725- "content" : {
4726- "application/json" : {
4727- "schema" : {
4728- "$ref" : " #/components/schemas/utils.ErrorResponse"
4729- }
4730- }
4731- }
4732- },
4733- "404" : {
4734- "description" : " Not Found" ,
4735- "content" : {
4736- "application/json" : {
4737- "schema" : {
4738- "$ref" : " #/components/schemas/utils.ErrorResponse"
4739- }
4740- }
4741- }
4742- },
4743- "500" : {
4744- "description" : " Internal Server Error" ,
4745- "content" : {
4746- "application/json" : {
4747- "schema" : {
4748- "$ref" : " #/components/schemas/utils.ErrorResponse"
4749- }
4750- }
4751- }
4752- }
4753- },
4754- "security" : [
4755- {
4756- "RhIdentity" : []
4757- }
4758- ]
47594702 }
47604703 },
47614704 "/systems/{inventory_id}/advisories" : {
Original file line number Diff line number Diff line change @@ -213,8 +213,8 @@ func CleanAADHandler(c *gin.Context) {
213213// @Failure 500 {object} string
214214// @Router /systems/{inventory_id} [delete]
215215func SystemDeleteHandler (c * gin.Context ) {
216- account := c .Query ("rh_account_id" )
217- if account == "" {
216+ account , err := strconv . Atoi ( c .Query ("rh_account_id" ) )
217+ if err != nil {
218218 utils .LogAndRespBadRequest (c , errors .New ("bad request" ), "rh_account_id query param not found" )
219219 return
220220 }
@@ -236,7 +236,7 @@ func SystemDeleteHandler(c *gin.Context) {
236236
237237 defer tx .Rollback ()
238238
239- err : = tx .Set ("gorm:query_option" , "FOR UPDATE OF system_platform" ).
239+ err = tx .Set ("gorm:query_option" , "FOR UPDATE OF system_platform" ).
240240 Table ("system_platform" ).
241241 Where ("rh_account_id = ?" , account ).
242242 Where ("inventory_id = ?::uuid" , inventoryID ).
You can’t perform that action at this time.
0 commit comments