1 parent
6697d2b229
commit
5af46b32f6
82 files changed
+4149
-345
No files matched your search
@@ -11,8 +11,8 @@ import (
|
||||
)
|
||||
|
||||
type emailDeleteRequest struct {
|
||||
IDs []int64 `json:"ids"`
|
||||
ForcedDel bool `json:"forcedDel"`
|
||||
IDs []int `json:"ids"`
|
||||
ForcedDel bool `json:"forcedDel"`
|
||||
}
|
||||
|
||||
func EmailDelete(ctx *context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
|
||||
@@ -2,11 +2,9 @@ package controllers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/Jinnrry/pmail/db"
|
||||
"github.com/Jinnrry/pmail/dto"
|
||||
"github.com/Jinnrry/pmail/dto/response"
|
||||
"github.com/Jinnrry/pmail/i18n"
|
||||
"github.com/Jinnrry/pmail/models"
|
||||
"github.com/Jinnrry/pmail/services/group"
|
||||
"github.com/Jinnrry/pmail/utils/array"
|
||||
"github.com/Jinnrry/pmail/utils/context"
|
||||
@@ -67,13 +65,8 @@ func AddGroup(ctx *context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
log.WithContext(ctx).Errorf("%+v", err)
|
||||
}
|
||||
|
||||
var newGroup models.Group = models.Group{
|
||||
Name: reqData.Name,
|
||||
ParentId: reqData.ParentId,
|
||||
UserId: ctx.UserID,
|
||||
}
|
||||
newGroup, err := group.CreateGroup(ctx, reqData.Name, reqData.ParentId)
|
||||
|
||||
_, err = db.Instance.Insert(&newGroup)
|
||||
if err != nil {
|
||||
response.NewErrorResponse(response.ServerError, "DBError", err.Error()).FPrint(w)
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user