This is an automated email from the ASF dual-hosted git repository.
linkinstar pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/answer.git
The following commit(s) were added to refs/heads/dev by this push:
new aabce873 fix initSiteInfo
aabce873 is described below
commit aabce8735ecd58c0e759f5477e8b55fec2d4484e
Author: Bzz <[email protected]>
AuthorDate: Mon Feb 24 14:32:53 2025 +0500
fix initSiteInfo
---
internal/migrations/init.go | 17 +++++++++++------
ui/src/pages/Admin/Write/index.tsx | 8 ++++----
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/internal/migrations/init.go b/internal/migrations/init.go
index a8e4b20e..36529615 100644
--- a/internal/migrations/init.go
+++ b/internal/migrations/init.go
@@ -23,9 +23,10 @@ import (
"context"
"encoding/json"
"fmt"
- "github.com/apache/answer/internal/base/constant"
"time"
+ "github.com/apache/answer/internal/base/constant"
+
"github.com/apache/answer/internal/base/data"
"github.com/apache/answer/internal/repo/unique"
"github.com/apache/answer/internal/schema"
@@ -253,11 +254,15 @@ func (m *Mentor) initSiteInfoPrivilegeRank() {
func (m *Mentor) initSiteInfoWrite() {
writeData := map[string]interface{}{
- "restrict_answer": true,
- "max_image_size": 4,
- "max_attachment_size": 8,
- "max_image_megapixel": 40,
- "authorized_extensions": []string{"jpg", "jpeg", "png", "gif",
"webp"},
+ "restrict_answer": true,
+ "required_tag": false,
+ "recommend_tags": []string{},
+ "reserved_tags": []string{},
+ "max_image_size": 4,
+ "max_attachment_size": 8,
+ "max_image_megapixel": 40,
+ "authorized_image_extensions": []string{"jpg", "jpeg",
"png", "gif", "webp"},
+ "authorized_attachment_extensions": []string{},
}
writeDataBytes, _ := json.Marshal(writeData)
_, m.err = m.engine.Context(m.ctx).Insert(&entity.SiteInfo{
diff --git a/ui/src/pages/Admin/Write/index.tsx
b/ui/src/pages/Admin/Write/index.tsx
index 91e41493..f7832e7f 100644
--- a/ui/src/pages/Admin/Write/index.tsx
+++ b/ui/src/pages/Admin/Write/index.tsx
@@ -53,22 +53,22 @@ const initFormData = {
isInvalid: false,
},
max_image_size: {
- value: 4,
+ value: 0,
errorMsg: '',
isInvalid: false,
},
max_attachment_size: {
- value: 8,
+ value: 0,
errorMsg: '',
isInvalid: false,
},
max_image_megapixel: {
- value: 40,
+ value: 0,
errorMsg: '',
isInvalid: false,
},
authorized_image_extensions: {
- value: 'jpg, jpeg, png, gif, webp',
+ value: '',
errorMsg: '',
isInvalid: false,
},