Project

General

Profile

dev #2006

Updated by Ayat Rahman about 1 year ago

Develop POST /api/v1/ai-tool/bulk-create #### **Description:** 

 Implement the PATCH route for updating the tool details (category, tags, features, etc.) based on the provided Step 2 form data. 

 #### **Tasks:** 

 1.    **Create PATCH Route:** 
    
     -     Define the `/api/tools/:id` route to create multiple tools handle the update of tool details. 
 2.    **Validate Data:** 
    
     -     Use Zod for data validation to ensure all fields (category, tags, features, etc.) are valid. 
     -     Allow optional fields to be updated and validated accordingly. 
 3.    **Update Tool Entry:** 
    
     -     Update the tool entry in one request. Validate input array (toolName, platformLinks), handle duplicates the database with new details. 
     -     Ensure that old data persists where necessary (e.g., user can continue from the form later). 
 4.    **Response:** 
    
     -     Return a 400 error, success response with the updated tool details. 

 #### **Acceptance Criteria:** 

 -     The PATCH route is functional and optimize for batch database insertion. updates the tool details as per the request. 
 -     Data validation is handled correctly with Zod. 
 -     Old data persists where needed, and the tool can be updated later.

Back