@overmap-ai/core 1.0.62-store-clear-fixes.5 → 1.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1986,7 +1986,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1986
1986
|
);
|
|
1987
1987
|
const selectProjectsOfOrganization = restructureCreateSelectorWithArgs(
|
|
1988
1988
|
toolkit.createSelector([selectProjects, (_, organizationId) => organizationId], (projects, organizationId) => {
|
|
1989
|
-
return Object.values(projects).filter((project) => project.
|
|
1989
|
+
return Object.values(projects).filter((project) => project.organization_owner === organizationId);
|
|
1990
1990
|
})
|
|
1991
1991
|
);
|
|
1992
1992
|
const selectLicensesOfOrganization = restructureCreateSelectorWithArgs(
|
|
@@ -5348,16 +5348,16 @@ var __publicField = (obj, key, value) => {
|
|
|
5348
5348
|
* @throws An APIError if the server returns an error, or any other error that may occur.
|
|
5349
5349
|
*/
|
|
5350
5350
|
async add(project) {
|
|
5351
|
-
if (!project.
|
|
5351
|
+
if (!project.organization_owner && !project.user_owner) {
|
|
5352
5352
|
throw new Error("Project type was not chosen when trying to create a project");
|
|
5353
5353
|
}
|
|
5354
5354
|
if (!project.bounds && !project.canvas_bounds) {
|
|
5355
5355
|
throw new Error("Project must either have bounds or canvas_bounds set");
|
|
5356
5356
|
}
|
|
5357
|
-
const isOrganizationProject = !!project.
|
|
5358
|
-
const url = isOrganizationProject ? `/organizations/${project.
|
|
5359
|
-
const projectType = isOrganizationProject ? { organization_owner: project.
|
|
5360
|
-
|
|
5357
|
+
const isOrganizationProject = !!project.organization_owner;
|
|
5358
|
+
const url = isOrganizationProject ? `/organizations/${project.organization_owner}/projects/` : "/projects/";
|
|
5359
|
+
const projectType = isOrganizationProject ? { organization_owner: project.organization_owner } : { user_owner: project.user_owner };
|
|
5360
|
+
return await this.enqueueRequest({
|
|
5361
5361
|
description: "Create project",
|
|
5362
5362
|
method: HttpMethod.POST,
|
|
5363
5363
|
url,
|
|
@@ -5369,7 +5369,6 @@ var __publicField = (obj, key, value) => {
|
|
|
5369
5369
|
blockers: [],
|
|
5370
5370
|
blocks: []
|
|
5371
5371
|
});
|
|
5372
|
-
return result;
|
|
5373
5372
|
}
|
|
5374
5373
|
async update(project) {
|
|
5375
5374
|
if (!project.bounds && !project.canvas_bounds) {
|