Skip to content

Commit 9a013b6

Browse files
committed
fix: review
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
1 parent 5faf875 commit 9a013b6

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

frontend/src/modules/organization/services/organization.api.service.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ export class OrganizationApiService {
2929
}
3030

3131
static async fetchMergeSuggestions(limit: number = 20, offset: number = 0, query: any = {}) {
32-
const segments = getSelectedProjectGroupId() ?? [];
32+
const segments = getSelectedProjectGroupId();
3333

3434
const data = {
3535
limit,
3636
offset,
37-
segments,
37+
...(segments ? { segments } : {}),
3838
...query,
3939
};
4040

@@ -46,11 +46,12 @@ export class OrganizationApiService {
4646
}
4747

4848
static create(data: Partial<Organization>) {
49+
const segments = getSelectedProjectGroupId();
4950
return authAxios.post(
5051
'/organization',
5152
{
5253
...data,
53-
segments: getSelectedProjectGroupId(),
54+
...(segments ? { segments } : {}),
5455
},
5556
)
5657
.then(({ data }) => Promise.resolve(data));

services/libs/data-access-layer/src/collections/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import { QueryOptions } from '../utils'
1616
export interface ICreateCollection {
1717
categoryId: string
1818
color?: string | null
19-
description?: string
19+
description?: string | null
2020
imageUrl?: string | null
2121
name: string
22-
slug?: string
22+
slug?: string | null
2323
starred: boolean
2424
isPrivate?: boolean
2525
ssoUserId?: string | null
@@ -139,12 +139,12 @@ export async function createCollection(
139139
collection: ICreateCollection,
140140
): Promise<ICollection> {
141141
const data = {
142-
description: null,
143-
slug: null,
144-
logoUrl: null,
145-
imageUrl: null,
146-
color: null,
147142
...collection,
143+
description: collection.description ?? null,
144+
slug: collection.slug ?? null,
145+
logoUrl: collection.logoUrl ?? null,
146+
imageUrl: collection.imageUrl ?? null,
147+
color: collection.color ?? null,
148148
}
149149
return qx.selectOne(
150150
`

0 commit comments

Comments
 (0)