create-amoxi-app 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -11,9 +11,10 @@ export class NoteController {
|
|
|
11
11
|
return this.notes.list();
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
//
|
|
14
|
+
// Body<NewNote> is the JSON request body, validated against the NewNote type: invalid
|
|
15
|
+
// bodies are rejected with a 400 listing every problem before this runs.
|
|
15
16
|
@Post()
|
|
16
|
-
create(
|
|
17
|
+
create(body: Body<NewNote>): HttpResponse<Note> {
|
|
17
18
|
return HttpResponse.created(this.notes.add(body));
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -7,7 +7,7 @@ export class NoteService {
|
|
|
7
7
|
private readonly notes: Note[] = [];
|
|
8
8
|
private nextId = 1;
|
|
9
9
|
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(private readonly max: Value<number, 'notes.max', 100>) {}
|
|
11
11
|
|
|
12
12
|
@PostConstruct()
|
|
13
13
|
seed(): void {
|
|
@@ -11,9 +11,10 @@ export class NoteController {
|
|
|
11
11
|
return this.notes.list();
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
//
|
|
14
|
+
// Body<NewNote> is the JSON request body, validated against the NewNote type: invalid
|
|
15
|
+
// bodies are rejected with a 400 listing every problem before this runs.
|
|
15
16
|
@Post()
|
|
16
|
-
create(
|
|
17
|
+
create(body: Body<NewNote>): HttpResponse<Note> {
|
|
17
18
|
return HttpResponse.created(this.notes.add(body));
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -7,7 +7,7 @@ export class NoteService {
|
|
|
7
7
|
private readonly notes: Note[] = [];
|
|
8
8
|
private nextId = 1;
|
|
9
9
|
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(private readonly max: Value<number, 'notes.max', 100>) {}
|
|
11
11
|
|
|
12
12
|
@PostConstruct()
|
|
13
13
|
seed(): void {
|