fix: avoid null value
This commit is contained in:
@ -39,17 +39,16 @@ func (h *AdminHandler) GetAllPermissions(w http.ResponseWriter, r *http.Request)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println("DEBUG: Appending row dto:", RowDTO{
|
|
||||||
Scope: row.Scope,
|
|
||||||
Permissions: permissions,
|
|
||||||
})
|
|
||||||
|
|
||||||
mapped = append(mapped, RowDTO{
|
mapped = append(mapped, RowDTO{
|
||||||
Scope: row.Scope,
|
Scope: row.Scope,
|
||||||
Permissions: permissions,
|
Permissions: permissions,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(mapped) == 0 {
|
||||||
|
mapped = make([]RowDTO, 0)
|
||||||
|
}
|
||||||
|
|
||||||
encoder := json.NewEncoder(w)
|
encoder := json.NewEncoder(w)
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
Reference in New Issue
Block a user