comparison pkg/controllers/routes.go @ 5028:d727641911a5

Moved import desision logic to import queue (where it belongs). Major change: StageDone of the import job is executed by the original user who does the import.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 18 Mar 2020 17:52:00 +0100
parents 3f704ebad0c5
children 2dcfab23dc86 445daeefca7b
comparison
equal deleted inserted replaced
5027:fa662af56a3d 5028:d727641911a5
311 })).Methods(http.MethodGet) 311 })).Methods(http.MethodGet)
312 312
313 api.Handle("/imports", waterwayAdmin(&mw.JSONHandler{ 313 api.Handle("/imports", waterwayAdmin(&mw.JSONHandler{
314 Input: func(*http.Request) interface{} { return &[]models.Review{} }, 314 Input: func(*http.Request) interface{} { return &[]models.Review{} },
315 Handle: reviewImports, 315 Handle: reviewImports,
316 NoConn: true,
316 })).Methods(http.MethodPatch) 317 })).Methods(http.MethodPatch)
317 318
318 api.Handle("/imports/{id:[0-9]+}", waterwayAdmin(&mw.JSONHandler{ 319 api.Handle("/imports/{id:[0-9]+}", waterwayAdmin(&mw.JSONHandler{
319 Handle: deleteImport, 320 Handle: deleteImport,
320 })).Methods(http.MethodDelete) 321 })).Methods(http.MethodDelete)
321 322
322 // Handler to review an import which is pending. 323 // Handler to review an import which is pending.
323 api.Handle("/imports/{id:[0-9]+}/{state:(?:accepted|declined)}", 324 api.Handle("/imports/{id:[0-9]+}/{state:(?:accepted|declined)}",
324 waterwayAdmin(&mw.JSONHandler{ 325 waterwayAdmin(&mw.JSONHandler{
325 Handle: reviewImport, 326 Handle: reviewImport,
327 NoConn: true,
326 })).Methods(http.MethodPut) 328 })).Methods(http.MethodPut)
327 329
328 // Handler to serve data to the client. 330 // Handler to serve data to the client.
329 331
330 api.Handle("/data/stretch/shape/{name:.+}", any( 332 api.Handle("/data/stretch/shape/{name:.+}", any(