Browse Source

En cours de développement

master
mls-361 2 months ago
parent
commit
f262b2aad2
  1. 13
      internal/api/api.go

13
internal/api/api.go

@ -10,11 +10,14 @@ import (
"expvar"
"net/http"
"forge.chapril.org/armen/jw"
"forge.chapril.org/mls-361/jsonapi"
"forge.chapril.org/armen/armen/internal/components"
)
const (
//_maxBodySize = 1024 * 4
_maxBodySize = 1024 * 32
)
type api struct {
@ -28,7 +31,13 @@ func newAPI(model components.Model) *api {
}
func (api *api) createJob(rw http.ResponseWriter, r *http.Request) {
rw.WriteHeader(http.StatusOK)
job := new(jw.Job)
if err := jsonapi.Decode(rw, r, _maxBodySize, job); err != nil {
return
}
_, _ = api.model.CreateJob(job) // Bad or Internal ?
}
func Build(router components.Router, model components.Model) {

Loading…
Cancel
Save