ILEX-91 Organization - new organization post integration#91
ILEX-91 Organization - new organization post integration#91
Conversation
src/api/endpoints/apiActions.ts
Outdated
| method: "GET", | ||
| params, | ||
| signal, | ||
| // params, |
src/api/endpoints/apiService.ts
Outdated
| return createPostRequest<any, any>(endpoint, "application/json")(data); | ||
| }; | ||
|
|
||
| // export const getOrganizations = (group: string) => { |
There was a problem hiding this comment.
please clean up if not needed.
src/api/endpoints/index.ts
Outdated
|
|
||
| /** Call Endpoint */ | ||
| return postPrivOrgNew(organization).then((response) => { | ||
| console.log("Post new organization ", response) |
src/components/Auth/Login.jsx
Outdated
| if (!e.data || !e.data.orcid_meta) return; | ||
| // TODO: get the session cookie when here and add it to our domain. | ||
| // also store the user info once logged from here in the local storage for future usage. | ||
| console.log(e.data); |
|
|
||
| try { | ||
| const response = await createNewOrganization({ group: groupname, data: "a test" }) | ||
| console.log("response: ", response) |
| console.log("response: ", response) | ||
|
|
||
| } catch (err) { | ||
| console.log('An unknown error occurred: ', err); |
There was a problem hiding this comment.
change it in a console.error if we want to report an error
| <Typography fontSize='1.5rem' color={gray700} fontWeight={600} mb='1.5rem'> | ||
| {organizations?.length} Organizations | ||
| </Typography> | ||
| <Button type="string" startIcon={<GroupAddOutlinedIcon />} onClick={createOrganization}>Create a new organizations</Button> |
There was a problem hiding this comment.
typo, change organizations with organization, we are trying to create one, not many
| // TODO: change this to be dynamic when we get the response from api call | ||
| const groupname = "aigul" | ||
|
|
||
| const fetchOrganizations = async() => { |
There was a problem hiding this comment.
@Aiga115 this code is exactly the same we have in Dashboard/Prganizations/index.jsx, could you factor this out in a util module so that we can re-use the same code here and in the other file? If you need to you can pass the hooks as parameter, but at least we avoid to repeat code that needs to be maintained. Thanks
| setOpen(false); | ||
| }; | ||
|
|
||
| const createOrganization = async (event) => { |
There was a problem hiding this comment.
@Aiga115 same for this function here, it is the same of the other file, same comment. Thanks
Issue #ILEX-91
Problem: Organization - new organization post integration
Solution:
Result:
Recording.2025-04-21.230141.mp4