Closed od-hunter closed 1 month ago
@od-hunter is attempting to deploy a commit to the LFG Labs Team on Vercel.
A member of the Team first needs to authorize it.
The changes introduce a new task type, CustomApi
, in the admin dashboard, enhancing the existing functionality to handle custom API tasks. This includes updates to various components and services to manage the creation and updating of custom API configurations, alongside modifications to type definitions to accommodate the new task structure.
Files | Change Summary |
---|---|
app/admin/quests/dashboard/[questId]/page.tsx, components/admin/formSteps/TaskDetailsForm.tsx, components/admin/taskSteps/customApiStep.tsx | Introduced a new type CustomApi in StepMap and updated the Page function to handle custom_api tasks. Added conditional rendering for CustomApi in TaskDetailsForm , and created a new CustomApiStep component to manage API-related fields. |
constants/admin.ts | Added "CustomApi" to TASK_OPTIONS and created CustomApiInput with several properties. Updated getDefaultValues function to return CustomApiInput for the new task type. |
services/authService.ts | Introduced createCustomApi and updateCustomApi functions for handling API task creation and updates, with error handling and integration into the AdminService . |
types/backTypes.d.ts, types/frontTypes.d.ts | Modified UserTask to include optional properties api_url and regex . Added new types CreateCustomApi and UpdateCustomApi for task creation and updates. Updated StepMap and TaskType to incorporate CustomApi . |
Objective | Addressed | Explanation |
---|---|---|
Add a new task type in the admin dashboard: custom_api (Issue #835) |
✅ | |
Implement the creation process of this new task type in the front | ✅ | |
Use fields from the balance task as an example for the new task type |
❌ | The implementation does not reuse fields from balance . |
Ensure both URL and API URL fields are included in the new task type |
✅ |
Page
function in the same file, indicating a direct relationship with the changes made in this PR regarding task handling logic.Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Also, there is an issue because customApi starts with the word "custom", and it makes both tabs shown as selected:
You can fix it really easily in components\admin\formSteps\TaskDetailsForm.tsx
by updating lines 179 and 184: replace the .includes(
by a simple ===
Also, changes are missing in app\admin\quests\create\page.tsx
Pull Request type
Please add the labels corresponding to the type of changes your PR introduces:
Resolves: #835
Other information
Summary by CodeRabbit
New Features
CustomApiStep
component for inputting API configuration details.TaskDetailsForm
to handle custom API steps.Bug Fixes
Documentation