Description
Description 📹
Currently, in the admin dashboard, while editing the quest reward, users can now upload .webp
images directly instead of only using image URLs. However, the functionality for uploading and handling these images has not yet been implemented. The goal of this issue is to add logic that allows the automatic upload of images using the provided API endpoint. Once uploaded, the respective fields (NFT Image Path and Issuer Logo) should be automatically populated with the image path.
Proposed Actions 🛠️
Here’s a checklist of actions to follow for resolving this issue:
- Fork and Create Branch:
Fork the repository and create a new branch using the issue number:
git checkout -b fix-[issue-number]
- Implement Changes:
- Create a function to handle image upload using the endpoint from https://github.com/lfglabs-dev/api.starknet.quest/blob/testnet/src/endpoints/admin/upload_image.rs
- Construct the image name dynamically based on the quest ID:
<quest_id>_nft
for NFT image,<quest_id>_issuer
for issuer logo - Modify the admin dashboard UI logic to trigger this upload on image file selection
- After upload, automatically populate the corresponding field with the uploaded image path
- Add error handling and success notifications
- Run Tests and Commit Changes:
Make sure your changes don't break existing functionality and commit with a clear message:
git commit -m "Fix: Add image upload support for quest reward editor"
Required 📋
To keep our workflow smooth, please make sure you follow these guidelines:
-
Assignment: Don't create a pull request if you weren’t assigned to this issue.
-
Timeframe: Complete the task within 3 business days.
-
Closing the Issue: In your PR description, close the issue by writing Close #[issue_id].
-
Review Process:
- Once you've submitted your PR, change the label to "ready for review".
- If changes are requested, address them and then update the label back to "ready for review" once done.
-
Testing: Test your PR locally before pushing, and verify that tests and build are working after pushing.
Thank you for your contribution 🙏