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
55export default async function handler ( req : APIRequest ) {
66 let count = store . $count || 0
77
8- switch ( req . params . get ( 'action' ) ) {
8+ switch ( req . params [ 'action' ] ) {
99 case 'increase' :
1010 count ++
1111 store . $count = count
@@ -20,7 +20,7 @@ export default async function handler(req: APIRequest) {
2020 req . status ( 400 ) . json ( {
2121 error : 'UnknownAction' ,
2222 status : 400 ,
23- message : `undefined action '${ req . params . get ( 'action' ) } '`
23+ message : `undefined action '${ req . params [ 'action' ] } '`
2424 } )
2525 break
2626 }
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const store = globalThis as any
55export default async function handler ( req : APIRequest ) {
66 let count = store . $count || 0
77
8- switch ( req . params . get ( 'action' ) ) {
8+ switch ( req . params [ 'action' ] ) {
99 case 'increase' :
1010 count ++
1111 store . $count = count
@@ -20,7 +20,7 @@ export default async function handler(req: APIRequest) {
2020 req . status ( 400 ) . json ( {
2121 error : 'UnknownAction' ,
2222 status : 400 ,
23- message : `undefined action '${ req . params . get ( 'action' ) } '`
23+ message : `undefined action '${ req . params [ 'action' ] } '`
2424 } )
2525 break
2626 }
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const store = globalThis as any
55export default async function handler ( req : APIRequest ) {
66 let count = store . $count || 0
77
8- switch ( req . params . get ( 'action' ) ) {
8+ switch ( req . params [ 'action' ] ) {
99 case 'increase' :
1010 count ++
1111 store . $count = count
@@ -20,7 +20,7 @@ export default async function handler(req: APIRequest) {
2020 req . status ( 400 ) . json ( {
2121 error : 'UnknownAction' ,
2222 status : 400 ,
23- message : `undefined action '${ req . params . get ( 'action' ) } '`
23+ message : `undefined action '${ req . params [ 'action' ] } '`
2424 } )
2525 break
2626 }
You can’t perform that action at this time.
0 commit comments