mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 16:04:23 +00:00
Save default settings with workspace creation
This commit is contained in:
@@ -54,6 +54,22 @@ func CreateWorkspace(db *db.DB) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
defaultSettings := &models.WorkspaceSettings{
|
||||
WorkspaceID: workspace.ID,
|
||||
Settings: models.UserSettings{
|
||||
Theme: "light",
|
||||
AutoSave: false,
|
||||
GitEnabled: false,
|
||||
GitAutoCommit: false,
|
||||
GitCommitMsgTemplate: "${action} ${filename}",
|
||||
},
|
||||
}
|
||||
|
||||
if err := db.SaveWorkspaceSettings(defaultSettings); err != nil {
|
||||
http.Error(w, "Failed to initialize workspace settings", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
respondJSON(w, workspace)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user