From d0b2864015aa09d33944434c9b1c5508d34dd194 Mon Sep 17 00:00:00 2001 From: GZTime Date: Sat, 23 Sep 2023 02:34:08 +0800 Subject: [PATCH] fix: can not empty post tags (#150) --- src/GZCTF/ClientApp/package.json | 4 ++-- src/GZCTF/ClientApp/pnpm-lock.yaml | 38 +++++++++++++++--------------- src/GZCTF/Models/Data/Post.cs | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/GZCTF/ClientApp/package.json b/src/GZCTF/ClientApp/package.json index 7668667cc..43f031cb5 100644 --- a/src/GZCTF/ClientApp/package.json +++ b/src/GZCTF/ClientApp/package.json @@ -25,7 +25,7 @@ "@mdi/js": "^7.2.96", "@mdi/react": "^1.6.1", "@microsoft/signalr": "^7.0.11", - "dayjs": "^1.11.9", + "dayjs": "^1.11.10", "echarts": "^5.4.3", "echarts-for-react": "^3.0.2", "embla-carousel": "^7.1.0", @@ -51,7 +51,7 @@ "@nabla/vite-plugin-eslint": "^1.5.0", "@trivago/prettier-plugin-sort-imports": "^4.2.0", "@types/katex": "^0.16.3", - "@types/node": "20.6.2", + "@types/node": "20.6.3", "@types/prismjs": "^1.26.0", "@types/react": "^18.2.22", "@types/react-dom": "^18.2.7", diff --git a/src/GZCTF/ClientApp/pnpm-lock.yaml b/src/GZCTF/ClientApp/pnpm-lock.yaml index 7296e1bd3..d165ad364 100644 --- a/src/GZCTF/ClientApp/pnpm-lock.yaml +++ b/src/GZCTF/ClientApp/pnpm-lock.yaml @@ -19,7 +19,7 @@ dependencies: version: 6.0.20(@emotion/react@11.11.1)(@mantine/hooks@6.0.20)(@types/react@18.2.22)(react-dom@18.2.0)(react@18.2.0) '@mantine/dates': specifier: ^6.0.20 - version: 6.0.20(@mantine/core@6.0.20)(@mantine/hooks@6.0.20)(dayjs@1.11.9)(react@18.2.0) + version: 6.0.20(@mantine/core@6.0.20)(@mantine/hooks@6.0.20)(dayjs@1.11.10)(react@18.2.0) '@mantine/dropzone': specifier: ^6.0.20 version: 6.0.20(@mantine/core@6.0.20)(@mantine/hooks@6.0.20)(react-dom@18.2.0)(react@18.2.0) @@ -48,8 +48,8 @@ dependencies: specifier: ^7.0.11 version: 7.0.11 dayjs: - specifier: ^1.11.9 - version: 1.11.9 + specifier: ^1.11.10 + version: 1.11.10 echarts: specifier: ^5.4.3 version: 5.4.3 @@ -122,8 +122,8 @@ devDependencies: specifier: ^0.16.3 version: 0.16.3 '@types/node': - specifier: 20.6.2 - version: 20.6.2 + specifier: 20.6.3 + version: 20.6.3 '@types/prismjs': specifier: ^1.26.0 version: 1.26.0 @@ -177,7 +177,7 @@ devDependencies: version: 5.2.2 vite: specifier: ^4.4.9 - version: 4.4.9(@types/node@20.6.2) + version: 4.4.9(@types/node@20.6.3) vite-plugin-pages: specifier: ^0.31.0 version: 0.31.0(vite@4.4.9) @@ -978,7 +978,7 @@ packages: - '@types/react' dev: false - /@mantine/dates@6.0.20(@mantine/core@6.0.20)(@mantine/hooks@6.0.20)(dayjs@1.11.9)(react@18.2.0): + /@mantine/dates@6.0.20(@mantine/core@6.0.20)(@mantine/hooks@6.0.20)(dayjs@1.11.10)(react@18.2.0): resolution: {integrity: sha512-pLxMRdHkLzswqhgJFyQE+Tyf5UuyOeed+FOpFxUzxmv9tHD2kKjr7CwfXSIv8utPF6RRKY9QYErFAGve1/Gg6g==} peerDependencies: '@mantine/core': 6.0.20 @@ -989,7 +989,7 @@ packages: '@mantine/core': 6.0.20(@emotion/react@11.11.1)(@mantine/hooks@6.0.20)(@types/react@18.2.22)(react-dom@18.2.0)(react@18.2.0) '@mantine/hooks': 6.0.20(react@18.2.0) '@mantine/utils': 6.0.20(react@18.2.0) - dayjs: 1.11.9 + dayjs: 1.11.10 react: 18.2.0 dev: false @@ -1143,7 +1143,7 @@ packages: '@types/eslint': 8.40.0 chalk: 4.1.2 eslint: 8.49.0 - vite: 4.4.9(@types/node@20.6.2) + vite: 4.4.9(@types/node@20.6.3) dev: true /@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1: @@ -1348,8 +1348,8 @@ packages: resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==} dev: true - /@types/node@20.6.2: - resolution: {integrity: sha512-Y+/1vGBHV/cYk6OI1Na/LHzwnlNCAfU3ZNGrc1LdRe/LAIbdDPTTv/HU3M7yXN448aTVDq3eKRm2cg7iKLb8gw==} + /@types/node@20.6.3: + resolution: {integrity: sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA==} /@types/parse-json@4.0.0: resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==} @@ -1527,7 +1527,7 @@ packages: '@babel/plugin-transform-react-jsx-self': 7.22.5(@babel/core@7.22.20) '@babel/plugin-transform-react-jsx-source': 7.22.5(@babel/core@7.22.20) react-refresh: 0.14.0 - vite: 4.4.9(@types/node@20.6.2) + vite: 4.4.9(@types/node@20.6.3) transitivePeerDependencies: - supports-color dev: true @@ -1884,8 +1884,8 @@ packages: engines: {node: '>= 12'} dev: true - /dayjs@1.11.9: - resolution: {integrity: sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA==} + /dayjs@1.11.10: + resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} dev: false /debug@4.3.4: @@ -4096,7 +4096,7 @@ packages: json5: 2.2.3 local-pkg: 0.4.3 picocolors: 1.0.0 - vite: 4.4.9(@types/node@20.6.2) + vite: 4.4.9(@types/node@20.6.3) yaml: 2.3.1 transitivePeerDependencies: - supports-color @@ -4122,7 +4122,7 @@ packages: clean-css: 5.3.2 flat-cache: 3.0.4 picocolors: 1.0.0 - vite: 4.4.9(@types/node@20.6.2) + vite: 4.4.9(@types/node@20.6.3) transitivePeerDependencies: - debug dev: true @@ -4138,13 +4138,13 @@ packages: debug: 4.3.4 globrex: 0.1.2 tsconfck: 2.1.2(typescript@5.2.2) - vite: 4.4.9(@types/node@20.6.2) + vite: 4.4.9(@types/node@20.6.3) transitivePeerDependencies: - supports-color - typescript dev: false - /vite@4.4.9(@types/node@20.6.2): + /vite@4.4.9(@types/node@20.6.3): resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -4172,7 +4172,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.6.2 + '@types/node': 20.6.3 esbuild: 0.18.19 postcss: 8.4.27 rollup: 3.29.2 diff --git a/src/GZCTF/Models/Data/Post.cs b/src/GZCTF/Models/Data/Post.cs index c288c9d97..cb3a8b207 100644 --- a/src/GZCTF/Models/Data/Post.cs +++ b/src/GZCTF/Models/Data/Post.cs @@ -62,7 +62,7 @@ internal Post Update(PostEditModel model, UserInfo user) Summary = string.IsNullOrEmpty(model.Summary) ? Summary : model.Summary; Content = string.IsNullOrEmpty(model.Content) ? Content : model.Content; IsPinned = model.IsPinned; - Tags = model.Tags.Length > 0 ? model.Tags.ToList() : Tags; + Tags = model.Tags.ToList(); Author = user; AuthorId = user.Id; UpdateTimeUTC = DateTimeOffset.UtcNow;