mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 07:54:22 +00:00
Initial git settings on frontend
This commit is contained in:
@@ -20,7 +20,7 @@ func SetupRoutes(r chi.Router, db *db.DB, fs *filesystem.FileSystem) {
|
||||
r.Delete("/*", DeleteFile(fs))
|
||||
})
|
||||
r.Route("/git", func(r chi.Router) {
|
||||
r.Post("commit", StageCommitAndPush(fs))
|
||||
r.Post("/commit", StageCommitAndPush(fs))
|
||||
r.Post("/pull", PullChanges(fs))
|
||||
})
|
||||
})
|
||||
|
||||
@@ -9,12 +9,12 @@ import (
|
||||
type UserSettings struct {
|
||||
Theme string `json:"theme" validate:"oneof=light dark"`
|
||||
AutoSave bool `json:"autoSave"`
|
||||
GitEnabled bool `json:"git_enabled"`
|
||||
GitURL string `json:"git_url" validate:"required_with=GitEnabled"`
|
||||
GitUser string `json:"git_user" validate:"required_with=GitEnabled"`
|
||||
GitToken string `json:"git_token" validate:"required_with=GitEnabled"`
|
||||
GitAutoCommit bool `json:"git_auto_commit"`
|
||||
GitCommitMsgTemplate string `json:"git_commit_msg_template"`
|
||||
GitEnabled bool `json:"gitEnabled"`
|
||||
GitURL string `json:"gitUrl" validate:"required_with=GitEnabled"`
|
||||
GitUser string `json:"gitUser" validate:"required_with=GitEnabled"`
|
||||
GitToken string `json:"gitToken" validate:"required_with=GitEnabled"`
|
||||
GitAutoCommit bool `json:"gitAutoCommit"`
|
||||
GitCommitMsgTemplate string `json:"gitCommitMsgTemplate"`
|
||||
}
|
||||
|
||||
type Settings struct {
|
||||
|
||||
Reference in New Issue
Block a user