SDN302_-_FA_2024_-_PE_2870.webp
Klaus_87

SDN302_-_FA_2024_-_PE_2870.webp

  • Media owner Klaus_87
  • Ngày thêm
Zoom

Body
201 Created 73 ms 471 B
Pretty
Raw Preview Visualize
JSON
1
{
2
3
"message": "Create a new department and add employees succesfully",
"result": {
4
"departmentId": "6705ffee87114567a57ec5e7",
5
6
"departmentName": "Customer Service",
"employeesList": [
7
{
8
"name": "Michael Ryan Doe"
9
},
10
{
11
"name": "Emily Jane Clark"
12
}
13
]
14
}
15
}
Figure 4: Result after insert successfully
Using model validation to check data input:
Ο No "name" data field when creating a new department, shown in Figure 5 - (0.25 marks)
Body
500 Internal Server Error
6 ms 355 B
Pretty
Raw Preview Visualize
JSON
1 {
2
"error": {
3
"status": 500,
4
"message": "department validation failed: name: Department name is required"
+ 95%
Close
Chưa có bình luận nào.

Thông tin

Category
SDN302
Thêm bởi
Klaus_87
Ngày thêm
Lượt xem
850
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
SDN302_-_FA_2024_-_PE_2870.webp
File size
181.7 KB
Dimensions
1920px x 991px

Share this media

Back
Bên trên Bottom