Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita4d86e9

Browse files
fix(site): Don't handle 304 as error (#6655)
1 parent331a49b commita4d86e9

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

‎site/src/api/api.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ import * as Types from "./types"
44
import{DeploymentConfig}from"./types"
55
import*asTypesGenfrom"./typesGenerated"
66

7+
// Adds 304 for the default axios validateStatus function
8+
// https://github.com/axios/axios#handling-errors
9+
// Check status here https://httpstatusdogs.com/
10+
axios.defaults.validateStatus=(status)=>{
11+
return(status>=200&&status<300)||status===304
12+
}
13+
714
exportconsthardCodedCSRFCookie=():string=>{
815
// This is a hard coded CSRF token/cookie pair for local development.
916
// In prod, the GoLang webserver generates a random cookie with a new token for

‎site/src/pages/TemplateSettingsPage/TemplateSettingsPage.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ export const TemplateSettingsPage: FC = () => {
1818
context:{ templateName, organizationId},
1919
actions:{
2020
onSave:(_,{ data})=>{
21-
// Use the data.name because the template name can be changed
22-
navigate(`/templates/${data.name}`)
21+
// Use the data.name because the template name can be changed. Since the
22+
// API can return 304 if the template name is not changed, we use the
23+
// templateName from the URL as default.
24+
navigate(`/templates/${data.name??templateName}`)
2325
},
2426
},
2527
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp