API: Add additional fields to label and subject edit forms #383 #3168

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-01-17 02:55:07 +01:00
parent d786a8225d
commit 0ada8d1095
99 changed files with 1241 additions and 1101 deletions

View File

@@ -26,17 +26,17 @@ func Connect(router *gin.RouterGroup) {
return
}
var f form.Connect
var frm form.Connect
// Assign and validate request form values.
if err := c.BindJSON(&f); err != nil {
if err := c.BindJSON(&frm); err != nil {
log.Warnf("connect: invalid form values (%s)", clean.Log(name))
Abort(c, http.StatusBadRequest, i18n.ErrAccountConnect)
return
}
if f.Invalid() {
log.Warnf("connect: invalid token %s", clean.Log(f.Token))
if frm.Invalid() {
log.Warnf("connect: invalid token %s", clean.Log(frm.Token))
Abort(c, http.StatusBadRequest, i18n.ErrAccountConnect)
return
}
@@ -62,7 +62,7 @@ func Connect(router *gin.RouterGroup) {
switch name {
case "hub":
old := conf.Hub().Session
err = conf.RenewApiKeysWithToken(f.Token)
err = conf.RenewApiKeysWithToken(frm.Token)
restart = old != conf.Hub().Session
default:
log.Errorf("connect: invalid service %s", clean.Log(name))