Skip to content

Commit af25fcd

Browse files
committed
generated all the necessary err msg
1 parent 4128fb5 commit af25fcd

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

public/js/ResourceModal.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,19 @@ class ResourceModal {
570570
console.log(error);
571571
for (var errorMessage in error){
572572
console.log(error[errorMessage]);
573+
if (error[errorMessage].includes("string")){
574+
if (key === 'contents.0.content'){
575+
errorMsgToDisplay += '<li> &bull; The content is required </li>';
576+
}
577+
}
573578
if (error[errorMessage].includes("is required")){
574579
console.log(key);
575580
if (key === 'name'){
576-
errorMsgToDisplay += '<li> The resource name is required </li>';
581+
errorMsgToDisplay += '<li> &bull; The resource name is required </li>';
582+
}
583+
// TODO: make this support having multiple contents
584+
if (key === 'contents.0.name'){
585+
errorMsgToDisplay += '<li> &bull; The resource content name is required </li>';
577586
}
578587
}
579588

resources/assets/sass/components/_resource.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ $off-wht: rgba(white,.4);
195195
// grid-area: buttons;
196196
display: grid;
197197
grid-template-columns: 35% 65%;
198-
grid-template-rows: auto auto auto;
198+
grid-template-rows: auto auto auto auto;
199199
grid-template-areas:
200200
"warning warning"
201201
"error error"

0 commit comments

Comments
 (0)