Skip to content

Commit bbf77c1

Browse files
committed
update 06
1 parent 01b008e commit bbf77c1

File tree

14 files changed

+41
-35
lines changed

14 files changed

+41
-35
lines changed

04-frameworks/08-nextjs/00-boilerplate/api-server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ app.get('/api/cars/:id', (context) => {
2323
return context.json(db.cars.find((c) => c.id === context.req.param('id')));
2424
});
2525

26-
app.put('/api/cars/:id', async (context) => {
26+
app.patch('/api/cars/:id', async (context) => {
2727
const id = context.req.param('id');
2828
const car = await context.req.json();
2929
db.cars = db.cars.map((c) =>

04-frameworks/08-nextjs/01-config/api-server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ app.get('/api/cars/:id', (context) => {
2323
return context.json(db.cars.find((c) => c.id === context.req.param('id')));
2424
});
2525

26-
app.put('/api/cars/:id', async (context) => {
26+
app.patch('/api/cars/:id', async (context) => {
2727
const id = context.req.param('id');
2828
const car = await context.req.json();
2929
db.cars = db.cars.map((c) =>

04-frameworks/08-nextjs/02-navigation/api-server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ app.get('/api/cars/:id', (context) => {
2323
return context.json(db.cars.find((c) => c.id === context.req.param('id')));
2424
});
2525

26-
app.put('/api/cars/:id', async (context) => {
26+
app.patch('/api/cars/:id', async (context) => {
2727
const id = context.req.param('id');
2828
const car = await context.req.json();
2929
db.cars = db.cars.map((c) =>

04-frameworks/08-nextjs/03-boilerplate/api-server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ app.get('/api/cars/:id', (context) => {
2323
return context.json(db.cars.find((c) => c.id === context.req.param('id')));
2424
});
2525

26-
app.put('/api/cars/:id', async (context) => {
26+
app.patch('/api/cars/:id', async (context) => {
2727
const id = context.req.param('id');
2828
const car = await context.req.json();
2929
db.cars = db.cars.map((c) =>

04-frameworks/08-nextjs/04-static-site-generation/api-server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ app.get('/api/cars/:id', (context) => {
2323
return context.json(db.cars.find((c) => c.id === context.req.param('id')));
2424
});
2525

26-
app.put('/api/cars/:id', async (context) => {
26+
app.patch('/api/cars/:id', async (context) => {
2727
const id = context.req.param('id');
2828
const car = await context.req.json();
2929
db.cars = db.cars.map((c) =>

04-frameworks/08-nextjs/05-server-side-rendering/api-server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ app.get('/api/cars/:id', (context) => {
2323
return context.json(db.cars.find((c) => c.id === context.req.param('id')));
2424
});
2525

26-
app.put('/api/cars/:id', async (context) => {
26+
app.patch('/api/cars/:id', async (context) => {
2727
const id = context.req.param('id');
2828
const car = await context.req.json();
2929
db.cars = db.cars.map((c) =>

04-frameworks/08-nextjs/06-client-side-rendering/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ npm install
1616

1717
If we don't need to pre-render the data and frequently updating data.
1818

19-
- Enalbe you to add client-side interactivity.
19+
- Enable you to add client-side interactivity.
2020
- Need to use `'use client'` directive.
2121
- You cannot use Server Components inside a client-side component but you can use Server Components as children of a client-side component.
2222
- [More info about Client Components](https://nextjs.org/docs/app/building-your-application/rendering/client-components)

04-frameworks/08-nextjs/06-client-side-rendering/api-server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ app.get('/api/cars/:id', (context) => {
2323
return context.json(db.cars.find((c) => c.id === context.req.param('id')));
2424
});
2525

26-
app.put('/api/cars/:id', async (context) => {
26+
app.patch('/api/cars/:id', async (context) => {
2727
const id = context.req.param('id');
2828
const car = await context.req.json();
2929
db.cars = db.cars.map((c) =>

04-frameworks/08-nextjs/06-client-side-rendering/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
5+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

04-frameworks/08-nextjs/06-client-side-rendering/package.json

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,31 @@
33
"version": "1.0.0",
44
"description": "Nextjs examples",
55
"scripts": {
6-
"start": "run-p start:dev start:api-server",
6+
"start": "run-p -l start:dev start:api-server",
77
"start:dev": "next dev",
88
"build": "rimraf .next && next build",
99
"start:prod": "next start -p 8080",
1010
"start:api-server": "cd api-server && npm run mock-server",
1111
"postinstall": "cd ./api-server && npm install"
1212
},
1313
"imports": {
14-
"#*": [
15-
"./src/*",
16-
"./src/*.ts",
17-
"./src/*.tsx",
18-
"./src/*/index.ts",
19-
"./src/*/index.tsx"
20-
]
14+
"#*": "./src/*"
2115
},
2216
"author": "Lemoncode",
2317
"license": "MIT",
2418
"dependencies": {
25-
"next": "^14.2.9",
19+
"next": "^15.1.6",
2620
"normalize.css": "^8.0.1",
27-
"react": "^18.3.1",
28-
"react-dom": "^18.3.1",
21+
"react": "^19.0.0",
22+
"react-dom": "^19.0.0",
2923
"sharp": "^0.33.5"
3024
},
3125
"devDependencies": {
32-
"@types/node": "22.5.4",
33-
"@types/react": "^18.3.5",
34-
"@types/react-dom": "^18.3.0",
26+
"@types/node": "22.13.1",
27+
"@types/react": "^19.0.8",
28+
"@types/react-dom": "^19.0.3",
3529
"npm-run-all": "^4.1.5",
3630
"rimraf": "^6.0.1",
37-
"typescript": "^5.6.2"
31+
"typescript": "^5.7.3"
3832
}
3933
}

0 commit comments

Comments
 (0)