refactor(documents): rename document tree model
This commit is contained in:
@@ -75,7 +75,7 @@ type ItemPatch struct {
|
||||
|
||||
type DepositResult struct {
|
||||
DocumentIdentity string
|
||||
ProjectIdentity string
|
||||
ProjectIdentity string
|
||||
}
|
||||
|
||||
type SourceRecord struct {
|
||||
@@ -363,9 +363,9 @@ func (s *Service) DepositItem(userID uint, itemIdentity, projectIdentity string)
|
||||
if !strings.HasSuffix(strings.ToLower(name), ".md") {
|
||||
name += ".md"
|
||||
}
|
||||
var document models.SaDocument
|
||||
var document models.SaDocumentTree
|
||||
err = s.db.Transaction(func(tx *gorm.DB) error {
|
||||
document = models.SaDocument{
|
||||
document = models.SaDocumentTree{
|
||||
ProjectID: project.ID, CreatedBy: userID, Kind: models.DocumentKindFile,
|
||||
Name: name, NormalizedName: strings.ToLower(name), Extension: ".md",
|
||||
MimeType: "text/markdown; charset=utf-8", Size: int64(len([]byte(body))),
|
||||
|
||||
Reference in New Issue
Block a user