Project

General

Profile

Actions

dev #2366

open

dev #2293: [Module] Sprint - 03

dev #2294: [BE]

dev #2298: [BE] Sprint 02 uncompleted tasks

[BE/FE] Multiple API issue Fixes, Verification Modals

Added by Ayat Rahman 12 months ago. Updated 11 months ago.

Status:
Complete
Priority:
High
Assignee:
Target version:
-
Start date:
04/24/2025
Due date:
04/24/2025 (about 12 months late)
% Done:

100%

Estimated time:
8:00 h
Spent time:

Description

This issue addresses multiple backend and frontend improvements to the AI Tools platform:

Fix "Get All Tools" API to correctly return bookmarksCount, commentsCount, and accurate toolVersion data.
Implement DNS and file verification modals (UI complete, backend integration pending).
General API fixes and performance improvements.
Remove default limit of 10 from tag API to allow flexible querying.
Add music AI discussion questions to the platform.

Changes

Get All Tools API Fix:

Issue: bookmarksCount and commentsCount were missing or incorrect; toolVersion lacked proper formatting.
Fix: Updated query to join bookmarks and comments tables for accurate counts; normalized toolVersion to consistent format (e.g., "v1.0.0").
File: src/api/tools/getAllTools.ts
Endpoint: GET /api/tools

DNS and File Verification Modals:

Implemented UI for DNS and file verification in VerificationProcess.tsx using single modal with step-based navigation.
Integration with /v1/verification/verify-ownership-with-dns and /v1/verification/verify-ownership-with-website-root-txt pending.
File: src/components/VerificationProcess.tsx

API Fixes and Improvements:

Optimized query performance for tool retrieval endpoints.
Fixed error handling for edge cases (e.g., invalid toolId).
Files: src/api/tools/*.ts

Tag API Limit Removal:

Removed default limit of 10 tags in GET /api/tags to support dynamic querying.
Added optional limit query parameter for client control.
File: src/api/tags/getTags.ts
Endpoint: GET /api/tags?limit=

Music AI Discussion Questions:

Added predefined discussion questions for music AI tools (e.g., "How does this tool generate Bangla music?").
Stored in discussionQuestions table, linked to aiTools with category = 'music'.
Files: src/db/schema.ts, src/api/discussions/addQuestions.ts

Acceptance Criteria

Get All Tools API:

Response includes accurate bookmarksCount, commentsCount, and toolVersion (e.g., {"id": "uuid", "bookmarksCount": 5, "commentsCount": 2, "toolVersion": "v1.0.0"}).
Verify: GET /api/tools.

Verification Modals:

DNS and file verification UI renders correctly in VerificationProcess modal.
Steps (select method, DNS/file input, verification) navigate without errors.
Verify: Test modal flow in /dashboard/my-tools.

API Fixes:

Tool APIs handle invalid inputs gracefully (e.g., 400 status for missing toolId).
Verify: Test /api/tools endpoints with edge cases.

Tag API:

GET /api/tags returns all tags without default limit; ?limit=5 returns 5 tags.
Verify: GET /api/tags and GET /api/tags?limit=5.

Actions

Also available in: Atom PDF