Skip to content

ILEX-91 Organization - new organization post integration#91

Merged
ddelpiano merged 17 commits intodevelfrom
feature/ILEX-91-B
Apr 22, 2025
Merged

ILEX-91 Organization - new organization post integration#91
ddelpiano merged 17 commits intodevelfrom
feature/ILEX-91-B

Conversation

@Aiga115
Copy link

@Aiga115 Aiga115 commented Apr 21, 2025

Issue #ILEX-91
Problem: Organization - new organization post integration
Solution:

  1. Create api calls to get organizations
  2. Handle 501 error when creating organization
  3. Render "Create new organization" modal to show the message from api call

Result:

Recording.2025-04-21.230141.mp4

@Aiga115 Aiga115 requested review from ddelpiano and jrmartin April 21, 2025 21:05
method: "GET",
params,
signal,
// params,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Aiga115 do we need this commented?

return createPostRequest<any, any>(endpoint, "application/json")(data);
};

// export const getOrganizations = (group: string) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please clean up if not needed.


/** Call Endpoint */
return postPrivOrgNew(organization).then((response) => {
console.log("Post new organization ", response)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove console.log please

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here


try {
const response = await createNewOrganization({ group: groupname, data: "a test" })
console.log("response: ", response)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean it up please

console.log("response: ", response)

} catch (err) {
console.log('An unknown error occurred: ', err);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo, change organizations with organization, we are trying to create one, not many

@Aiga115 Aiga115 requested a review from ddelpiano April 22, 2025 10:44
@ddelpiano ddelpiano merged commit 0d4bb03 into devel Apr 22, 2025
1 check passed
// TODO: change this to be dynamic when we get the response from api call
const groupname = "aigul"

const fetchOrganizations = async() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Aiga115 same for this function here, it is the same of the other file, same comment. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants