mirror of
https://github.com/1f349/site-hosting.git
synced 2025-04-12 22:56:02 +01:00
Output GET sites as an object of domains containing an array of branches
This commit is contained in:
parent
1f2e9880bc
commit
8d8d54df0d
@ -62,8 +62,13 @@ func New(upload *upload.Handler, keyStore *mjwt.KeyStore, db apiDB) *httprouter.
|
||||
return
|
||||
}
|
||||
|
||||
domains := make(map[string][]database.Branch)
|
||||
for _, i := range branches {
|
||||
domains[i.Domain] = append(domains[i.Domain], i)
|
||||
}
|
||||
|
||||
rw.WriteHeader(http.StatusOK)
|
||||
_ = json.NewEncoder(rw).Encode(branches)
|
||||
_ = json.NewEncoder(rw).Encode(domains)
|
||||
}))
|
||||
|
||||
// Site creation endpoint
|
||||
|
Loading…
x
Reference in New Issue
Block a user