Skip to content

Commit 0cb492b

Browse files
committedSep 19, 2023
fix(api): cannot delete post
1 parent c880ca2 commit 0cb492b

File tree

7 files changed

+157
-151
lines changed

7 files changed

+157
-151
lines changed
 

‎.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
VITE_APP_GIT_NAME: ${{ github.ref_name }}
4747

4848
- name: Docker setup QEMU
49-
uses: docker/setup-qemu-action@v2
49+
uses: docker/setup-qemu-action@v3
5050

5151
- name: Docker setup Buildx
5252
uses: docker/setup-buildx-action@v2

‎src/GZCTF.Test/GZCTF.Test.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.11" />
1818
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.11" />
1919
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
20-
<PackageReference Include="xunit" Version="2.5.0" />
21-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
20+
<PackageReference Include="xunit" Version="2.5.1" />
21+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
2222
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2323
<PrivateAssets>all</PrivateAssets>
2424
</PackageReference>
25-
<PackageReference Include="xunit.runner.console" Version="2.5.0">
25+
<PackageReference Include="xunit.runner.console" Version="2.5.1">
2626
<PrivateAssets>all</PrivateAssets>
2727
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2828
</PackageReference>

‎src/GZCTF/ClientApp/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"genapi": "swagger-typescript-api -p template/swagger.json -t template -o src --module-name-first-tag --sort-routes"
1212
},
1313
"dependencies": {
14-
"@babel/core": "^7.22.19",
14+
"@babel/core": "^7.22.20",
1515
"@emotion/react": "^11.11.1",
1616
"@mantine/carousel": "^6.0.20",
1717
"@mantine/core": "^6.0.20",
@@ -33,7 +33,7 @@
3333
"embla-carousel-react": "^7.1.0",
3434
"katex": "^0.16.8",
3535
"lz-string": "^1.5.0",
36-
"marked": "^9.0.1",
36+
"marked": "^9.0.3",
3737
"marked-highlight": "^2.0.6",
3838
"pdfjs-dist": "3.6.172",
3939
"prismjs": "^1.29.0",
@@ -53,10 +53,10 @@
5353
"@types/katex": "^0.16.3",
5454
"@types/node": "20.6.2",
5555
"@types/prismjs": "^1.26.0",
56-
"@types/react": "^18.2.21",
56+
"@types/react": "^18.2.22",
5757
"@types/react-dom": "^18.2.7",
58-
"@typescript-eslint/eslint-plugin": "^6.7.0",
59-
"@typescript-eslint/parser": "^6.7.0",
58+
"@typescript-eslint/eslint-plugin": "^6.7.2",
59+
"@typescript-eslint/parser": "^6.7.2",
6060
"@vitejs/plugin-react": "^4.0.4",
6161
"axios": "^1.5.0",
6262
"babel-plugin-prismjs": "^2.1.0",

‎src/GZCTF/ClientApp/pnpm-lock.yaml

+143-138
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/GZCTF/ClientApp/src/pages/account/Login.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ const Login: FC = () => {
3737
const onLogin = async (event: React.FormEvent) => {
3838
event.preventDefault()
3939

40-
setDisabled(true)
41-
4240
if (uname.length === 0 || pwd.length < 6) {
4341
showNotification({
4442
color: 'red',
@@ -62,6 +60,8 @@ const Login: FC = () => {
6260
return
6361
}
6462

63+
setDisabled(true)
64+
6565
showNotification({
6666
color: 'orange',
6767
id: 'login-status',

‎src/GZCTF/ClientApp/src/pages/posts/[postId]/edit.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const PostEdit: FC = () => {
3939
{
4040
refreshInterval: 0,
4141
revalidateOnFocus: false,
42+
shouldRetryOnError: false,
4243
},
4344
postId?.length === 8
4445
)

‎src/GZCTF/Controllers/EditController.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public async Task<IActionResult> UpdatePost(string id, [FromBody] PostEditModel
8989
/// <param name="token"></param>
9090
/// <response code="200">成功删除文章</response>
9191
/// <response code="404">未找到文章</response>
92-
[HttpDelete("Posts/{id:int}")]
92+
[HttpDelete("Posts/{id}")]
9393
[ProducesResponseType(StatusCodes.Status200OK)]
9494
[ProducesResponseType(typeof(RequestResponse), StatusCodes.Status404NotFound)]
9595
public async Task<IActionResult> DeletePost(string id, CancellationToken token)
@@ -779,4 +779,4 @@ public async Task<IActionResult> RemoveFlag([FromRoute] int id, [FromRoute] int
779779

780780
return Ok(await challengeRepository.RemoveFlag(challenge, fId, token));
781781
}
782-
}
782+
}

0 commit comments

Comments
 (0)
Please sign in to comment.