Skip to content

Commit

Permalink
#1289 | fix: handling mediaDirectory error
Browse files Browse the repository at this point in the history
  • Loading branch information
vedfordev committed Dec 5, 2024
1 parent 2a116fe commit 0781cb7
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/adminApp/Organisation.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,16 @@ export const OrganisationCreate = props => {
if (errorData.includes("organisation_db_user_key")) {
backendError["dbUser"] = `${data.dbUser} is already exist please use other name`;
}
}
if (Object.keys(backendError).length !== 0) {
setErrors(backendError);
return;
if (errorData.includes("organisation_media_directory_key")) {
backendError["mediaDirectory"] = `${data.mediaDirectory} is already exist please use other name`;
}
if (Object.keys(backendError).length !== 0) {
setErrors(backendError);
return;
} else {
backendError["other"] = errorData;
setErrors(backendError);
}
}
}
};
Expand Down Expand Up @@ -381,7 +387,9 @@ export const OrganisationCreate = props => {
/>
{errors.statusId && <FormHelperText error>{errors.statusId}</FormHelperText>}
</Grid>

<Grid item xs={6}>
{errors.other && <FormHelperText error>{errors.other}</FormHelperText>}
</Grid>
<Grid container item sm={12}>
<Grid item sm={2}>
<SaveComponent name="save" onSubmit={handleSubmit} styleClass={{ marginTop: "10px" }} />
Expand Down

0 comments on commit 0781cb7

Please sign in to comment.