This repository was archived by the owner on Jul 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
hello-world-spa/api/counter
hello-world-src-dir/src/api/counter Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const store = globalThis as any
5
5
export default async function handler ( req : APIRequest ) {
6
6
let count = store . $count || 0
7
7
8
- switch ( req . params . get ( 'action' ) ) {
8
+ switch ( req . params [ 'action' ] ) {
9
9
case 'increase' :
10
10
count ++
11
11
store . $count = count
@@ -20,7 +20,7 @@ export default async function handler(req: APIRequest) {
20
20
req . status ( 400 ) . json ( {
21
21
error : 'UnknownAction' ,
22
22
status : 400 ,
23
- message : `undefined action '${ req . params . get ( 'action' ) } '`
23
+ message : `undefined action '${ req . params [ 'action' ] } '`
24
24
} )
25
25
break
26
26
}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const store = globalThis as any
5
5
export default async function handler ( req : APIRequest ) {
6
6
let count = store . $count || 0
7
7
8
- switch ( req . params . get ( 'action' ) ) {
8
+ switch ( req . params [ 'action' ] ) {
9
9
case 'increase' :
10
10
count ++
11
11
store . $count = count
@@ -20,7 +20,7 @@ export default async function handler(req: APIRequest) {
20
20
req . status ( 400 ) . json ( {
21
21
error : 'UnknownAction' ,
22
22
status : 400 ,
23
- message : `undefined action '${ req . params . get ( 'action' ) } '`
23
+ message : `undefined action '${ req . params [ 'action' ] } '`
24
24
} )
25
25
break
26
26
}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const store = globalThis as any
5
5
export default async function handler ( req : APIRequest ) {
6
6
let count = store . $count || 0
7
7
8
- switch ( req . params . get ( 'action' ) ) {
8
+ switch ( req . params [ 'action' ] ) {
9
9
case 'increase' :
10
10
count ++
11
11
store . $count = count
@@ -20,7 +20,7 @@ export default async function handler(req: APIRequest) {
20
20
req . status ( 400 ) . json ( {
21
21
error : 'UnknownAction' ,
22
22
status : 400 ,
23
- message : `undefined action '${ req . params . get ( 'action' ) } '`
23
+ message : `undefined action '${ req . params [ 'action' ] } '`
24
24
} )
25
25
break
26
26
}
You can’t perform that action at this time.
0 commit comments