-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REST API: Slug is not created, when API or Organization is created #3373
Comments
Hi @marla-singer @matleppa, I'm a little bit confused about the below code, My question is, if someone wants to update only organization description and URL using Rest API call then update will be failed. // Organization with same name must not already exist
const duplicateOrganization = Organizations.findOne({ name: bodyParams.name });
if (duplicateOrganization) {
const detailLine = 'Duplicate: Organization with same name exists.';
const idValue = `${duplicateOrganization._id}`;
return errorMessagePayload(400, detailLine, 'id', idValue);
} Please correct me. |
You took the piece of code from method POST /organizations, right? The updates are done with method PUT /organization, so there is a checking, if parameter "name" is provided. |
@matleppa, No. I have taken the code from PUT/organization. code line number near 520. |
This is what I see in PUT /organization endpoint concerning parameter "name".
|
@deligence-dharmendra @preriasusi The goal is not to add a separate DB write for slug when Organization name is updated, but to get all changed (or new) Organization data ready and use only one DB write to get it into DB. The reason for it is that in APIs we need to be prepared for DB update failures also. In case there are several DB writes, we have to rollback possible previous successful write in case latter write fails. |
Description
When API or Organization is created, a slug must be created also (because the slug works as a link to API/Organization).
Problem
Within PR 3140 the way that a slug is formed was changed.
The change is not implemented in Catalog API or in Management API, thus the created API or Organization has not slug and the can not be referred, i.e. their profiles can not be managed.
Solution
Implement similar slug creation functionality into REST APIs as there is in UI related operations.
The text was updated successfully, but these errors were encountered: