SDN302_-_FA_2024_-_PE_2870.webp
Klaus_87

SDN302_-_FA_2024_-_PE_2870.webp

  • Media owner Klaus_87
  • Ngày thêm
12
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
{
234
"error": {
"status": 500,
"message": "department validation failed: name: Department name is required"
Body
5
}
6
}
Figure 5: No "name" data field
Ο When department name has existed, as shown in Figure 6-(0.25 marks)
Pretty
Raw Preview Visualize
JSON
1
{
2
"error": {
3
4
"status": 500,
5
}
6
}
Q
500 Internal Server Error
30 ms 413 B...
"message": "E11000 duplicate key error collection: SDN301_FALL24_B1.departments
index: name_1 dup key: { name: \"Customer Service\"}"
Zoom

+ 95%
Figure 6: Duplicate value of department name
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
750
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
196.7 KB
Dimensions
1920px x 991px

Share this media

Back
Bên trên Bottom