🗑️ Remove independent mode
This commit is contained in:
@ -74,12 +74,10 @@ func getAttachmentMeta(c *fiber.Ctx) error {
|
||||
|
||||
func createAttachment(c *fiber.Ctx) error {
|
||||
var user *models.Account
|
||||
if gap.H != nil {
|
||||
if err := gap.H.EnsureAuthenticated(c); err != nil {
|
||||
return err
|
||||
}
|
||||
user = lo.ToPtr(c.Locals("user").(models.Account))
|
||||
if err := gap.H.EnsureAuthenticated(c); err != nil {
|
||||
return err
|
||||
}
|
||||
user = lo.ToPtr(c.Locals("user").(models.Account))
|
||||
|
||||
destName := c.Query("destination", viper.GetString("preferred_destination"))
|
||||
|
||||
@ -97,10 +95,8 @@ func createAttachment(c *fiber.Ctx) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if gap.H != nil {
|
||||
if err := gap.H.EnsureGrantedPerm(c, "CreateAttachments", file.Size); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := gap.H.EnsureGrantedPerm(c, "CreateAttachments", file.Size); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
usermeta := make(map[string]any)
|
||||
@ -136,10 +132,6 @@ func createAttachment(c *fiber.Ctx) error {
|
||||
func updateAttachmentMeta(c *fiber.Ctx) error {
|
||||
id, _ := c.ParamsInt("id", 0)
|
||||
|
||||
if gap.H == nil {
|
||||
return fiber.NewError(fiber.StatusUnprocessableEntity, "server running in independent mode, unable to modify attachment meta")
|
||||
}
|
||||
|
||||
if err := gap.H.EnsureAuthenticated(c); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -176,10 +168,6 @@ func updateAttachmentMeta(c *fiber.Ctx) error {
|
||||
func deleteAttachment(c *fiber.Ctx) error {
|
||||
id, _ := c.ParamsInt("id", 0)
|
||||
|
||||
if gap.H == nil {
|
||||
return fiber.NewError(fiber.StatusUnprocessableEntity, "server running in independent mode, unable to delete attachment")
|
||||
}
|
||||
|
||||
if err := gap.H.EnsureAuthenticated(c); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user