GetApplications returns all applications a user has. swagger:operation GET /application application getApps Return all applications. --- consumes: [application/json] produces: [application/json] security: [clientTokenAuthorizationHeader: [], clientTokenHeader: [], clientTokenQuery: [], basicAu
(ctx *gin.Context)
| 135 | // schema: |
| 136 | // $ref: "#/definitions/Error" |
| 137 | func (a *ApplicationAPI) GetApplications(ctx *gin.Context) { |
| 138 | userID := auth.GetUserID(ctx) |
| 139 | apps, err := a.DB.GetApplicationsByUser(userID) |
| 140 | if success := successOrAbort(ctx, 500, err); !success { |
| 141 | return |
| 142 | } |
| 143 | for _, app := range apps { |
| 144 | withResolvedImage(app) |
| 145 | } |
| 146 | ctx.JSON(200, apps) |
| 147 | } |
| 148 | |
| 149 | // DeleteApplication deletes an application by its id. |
| 150 | // swagger:operation DELETE /application/{id} application deleteApp |