mirror of
https://github.com/pushbits/server.git
synced 2025-06-05 12:12:03 +02:00
Add option to control repair behavior
This commit is contained in:
parent
38b615a05d
commit
77765e77a9
9 changed files with 49 additions and 22 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"net/http"
|
||||
|
||||
"github.com/pushbits/server/internal/authentication"
|
||||
"github.com/pushbits/server/internal/configuration"
|
||||
"github.com/pushbits/server/internal/log"
|
||||
"github.com/pushbits/server/internal/model"
|
||||
|
||||
|
@ -104,7 +105,7 @@ func (h *ApplicationHandler) updateApplication(ctx *gin.Context, a *model.Applic
|
|||
return err
|
||||
}
|
||||
|
||||
err = h.DP.UpdateApplication(a)
|
||||
err = h.DP.UpdateApplication(a, &configuration.RepairBehavior{ResetRoomName: true, ResetRoomTopic: true})
|
||||
if success := SuccessOrAbort(ctx, http.StatusInternalServerError, err); !success {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"github.com/pushbits/server/internal/configuration"
|
||||
"github.com/pushbits/server/internal/model"
|
||||
)
|
||||
|
||||
|
@ -28,7 +29,7 @@ type Database interface {
|
|||
type Dispatcher interface {
|
||||
RegisterApplication(id uint, name, token, user string) (string, error)
|
||||
DeregisterApplication(a *model.Application, u *model.User) error
|
||||
UpdateApplication(a *model.Application) error
|
||||
UpdateApplication(a *model.Application, behavior *configuration.RepairBehavior) error
|
||||
}
|
||||
|
||||
// The CredentialsManager interface for updating credentials.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue