Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1b63471

Browse files
committed
fix params
1 parent a5d372a commit 1b63471

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

‎client/packages/lowcoder/src/api/userApi.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,14 @@ class UserApi extends Api {
141141
return Api.get(UserApi.currentUserURL);
142142
}
143143
static getMyOrgs(
144-
page: number = 1,
144+
pageNum: number = 1,
145145
pageSize: number = 20,
146-
search?: string
146+
orgName?: string
147147
): AxiosPromise<GetMyOrgsResponse> {
148148
const params = new URLSearchParams({
149-
page: page.toString(),
149+
pageNum: pageNum.toString(),
150150
pageSize: pageSize.toString(),
151-
...(search && { search })
151+
...(orgName && { orgName })
152152
});
153153

154154
return Api.get(`${UserApi.myOrgsURL}?${params}`);

‎client/packages/lowcoder/src/redux/sagas/orgSagas.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,20 +334,21 @@ export function* fetchWorkspacesSaga(action: ReduxAction<{page: number, search?:
334334

335335
const response: AxiosResponse<GetMyOrgsResponse> = yield call(
336336
UserApi.getMyOrgs,
337-
page,
338-
20, // pageSize
339-
search
337+
page, // pageNum
338+
5, // pageSize (changed to 5 for testing)
339+
search // orgName
340340
);
341341

342342
if (validateResponse(response)) {
343343
const apiData = response.data.data;
344+
console.log("apiData", apiData);
344345

345346
// Transform orgId/orgName to match Org interface
346347
const transformedItems = apiData.data.map(item => ({
347348
id: item.orgId,
348349
name: item.orgName,
349350
}));
350-
351+
351352
yield put({
352353
type: ReduxActionTypes.FETCH_WORKSPACES_SUCCESS,
353354
payload: {
@@ -358,7 +359,6 @@ export function* fetchWorkspacesSaga(action: ReduxAction<{page: number, search?:
358359
});
359360
}
360361
} catch (error: any) {
361-
// Handle error in component instead of Redux
362362
console.error('Error fetching workspaces:', error);
363363
}
364364
}

0 commit comments

Comments
 (0)