Implement workspace handlers integration tests

This commit is contained in:
2024-11-30 11:44:17 +01:00
parent 8bed3614ee
commit ae48761d34
3 changed files with 307 additions and 0 deletions

View File

@@ -41,6 +41,11 @@ func (h *Handler) CreateWorkspace() http.HandlerFunc {
return
}
if err := workspace.ValidateGitSettings(); err != nil {
http.Error(w, "Invalid workspace", http.StatusBadRequest)
return
}
workspace.UserID = ctx.UserID
if err := h.DB.CreateWorkspace(&workspace); err != nil {
http.Error(w, "Failed to create workspace", http.StatusInternalServerError)