feat: update fixing error
This commit is contained in:
parent
faecc65a46
commit
64ec492df4
|
|
@ -15,7 +15,4 @@ type ActivityLogs struct {
|
|||
UserId *uint `json:"user_id" gorm:"type:int4"`
|
||||
ClientId *uuid.UUID `json:"client_id" gorm:"type:UUID"`
|
||||
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
|
||||
|
||||
// Relations
|
||||
Article *Articles `json:"article" gorm:"foreignKey:ArticleId;constraint:OnDelete:CASCADE"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,4 @@ type ArticleApprovals struct {
|
|||
ApprovalAtLevel *int `json:"approval_at_level" gorm:"type:int4"`
|
||||
ClientId *uuid.UUID `json:"client_id" gorm:"type:UUID"`
|
||||
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
|
||||
|
||||
// Relations
|
||||
Article Articles `json:"article" gorm:"foreignKey:ArticleId;constraint:OnDelete:CASCADE"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ type ArticleComments struct {
|
|||
UpdatedAt time.Time `json:"updated_at" gorm:"default:now()"`
|
||||
|
||||
// Relations
|
||||
Article Articles `json:"article" gorm:"foreignKey:ArticleId;constraint:OnDelete:CASCADE"`
|
||||
Article Articles `json:"article" gorm:"foreignKey:ArticleId"`
|
||||
}
|
||||
|
||||
// statusId => 0: waiting, 1: accepted, 2: replied, 3: rejected
|
||||
|
|
|
|||
|
|
@ -29,5 +29,5 @@ type ArticleFiles struct {
|
|||
UpdatedAt time.Time `json:"updated_at" gorm:"default:now()"`
|
||||
|
||||
// Relations
|
||||
Article Articles `json:"article" gorm:"foreignKey:ArticleId;constraint:OnDelete:CASCADE"`
|
||||
Article Articles `json:"article" gorm:"foreignKey:ArticleId"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,14 +8,13 @@ import (
|
|||
|
||||
type Bookmarks struct {
|
||||
ID uint `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
|
||||
UserId uint `json:"user_id" gorm:"type:int4;not null"`
|
||||
ArticleId uint `json:"article_id" gorm:"type:int4;not null"`
|
||||
UserId uint `json:"user_id" gorm:"type:int4"`
|
||||
ArticleId uint `json:"article_id" gorm:"type:int4"`
|
||||
ClientId *uuid.UUID `json:"client_id" gorm:"type:UUID"`
|
||||
IsActive *bool `json:"is_active" gorm:"type:bool;default:true"`
|
||||
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
|
||||
UpdatedAt time.Time `json:"updated_at" gorm:"default:now()"`
|
||||
|
||||
// Relations
|
||||
User Users `json:"user" gorm:"foreignKey:UserId;references:ID"`
|
||||
Article Articles `json:"article" gorm:"foreignKey:ArticleId;references:ID"`
|
||||
Article Articles `json:"article" gorm:"foreignKey:ArticleId"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
package middleware
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"web-medols-be/app/database/entity"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/google/uuid"
|
||||
"gorm.io/gorm"
|
||||
"strings"
|
||||
"web-medols-be/app/database/entity"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -22,6 +23,7 @@ var excludedPaths = []string{
|
|||
"/clients",
|
||||
"/clients/*",
|
||||
"*/viewer/*",
|
||||
"/bookmarks/test-table",
|
||||
}
|
||||
|
||||
// isPathExcluded checks if the given path should be excluded from client key validation
|
||||
|
|
|
|||
Loading…
Reference in New Issue