Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add delete functionality for samples #103

Closed
wants to merge 18 commits into from

Conversation

waiyanzt
Copy link

@waiyanzt waiyanzt commented Oct 8, 2024

Added delete functionality for issue #67. Used react-icons for trash icon for delete button. delete button is placed next to edit button.
Used the /api/v1/sqldelete/{id} API endpoint to perform the deletion.
Also added a confirmation prompt before deletion to prevent accidental removals using the confirmDialog function as well as some additional error handling.

ui/src/pages/Samples/Samples.jsx Outdated Show resolved Hide resolved
@waiyanzt
Copy link
Author

waiyanzt commented Oct 9, 2024

I've made the requested changes, thanks for the feedback. Please review it when you can @sethumadhavan-k

ui/src/services/Sample.js Outdated Show resolved Hide resolved
@waiyanzt
Copy link
Author

waiyanzt commented Oct 9, 2024

Hi @sethumadhavan-k, I have adjusted as instructed. Sorry for the trouble

@sethumadhavan-k
Copy link
Collaborator

@zteezy19 let me check

@waiyanzt
Copy link
Author

Hi @sethumadhavan-k, I've changed the name of the confirmDailog function to confirmDialog to fix the typo, and also adjusted the usage of the function in the Samples.jsx. Please take a look thanks

@sethumadhavan-k
Copy link
Collaborator

@zteezy19 The parameter of the confirmDialog function is not an object. Please ensure it follows the example provided, and for now, don't change the function name.

example :
confirmDailog("Are you sure you want to delete this?", "", {deleteicon}, {cancelicon}, {confirmButtonText}, {deleteButtononClickFunction})

@waiyanzt
Copy link
Author

Hi @sethumadhavan-k , I think I've adjusted as requested.

@sethumadhavan-k
Copy link
Collaborator

@zteezy19 let me check this.

@agberoz agberoz linked an issue Oct 15, 2024 that may be closed by this pull request
@sethumadhavan-k
Copy link
Collaborator

@zteezy19 getting this error in frontend

Screenshot 2024-10-15 at 6 51 04 PM

}


export const deleteSample = (sampleId) => {
return DeleteService(`${API_URL}/sql/delete/${sampleId}`);
Copy link
Collaborator

@sethumadhavan-k sethumadhavan-k Oct 15, 2024

Choose a reason for hiding this comment

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

delete API url is /sqldelete/{id} not /sql/delete/{id}

@waiyanzt
Copy link
Author

Hi, I've fixed the API url typo.

@sethumadhavan-k
Copy link
Collaborator

sethumadhavan-k commented Oct 17, 2024

@zteezy19 let me check

@sethumadhavan-k
Copy link
Collaborator

sethumadhavan-k commented Oct 17, 2024

@zteezy19 please update the sample delete API url to /sqldelete/{id} also i am getting the same error

Screenshot 2024-10-15 at 6 51 04 PM

@waiyanzt
Copy link
Author

Hi, sorry, I did not commit the codes properly. The changes should be committed. so sorry for the newbie mistakes

@sethumadhavan-k
Copy link
Collaborator

sethumadhavan-k commented Oct 18, 2024

@zteezy19 please join on our slack channel https://join.slack.com/t/theailounge/shared_invite/zt-2ogkrruyf-FPOHuPr5hdqXl34bDWjHjw, i will assist

@waiyanzt waiyanzt closed this by deleting the head repository Oct 24, 2024
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.

Add delete funcationality for samples
2 participants