feat(dashboard): add scrape portals widget to dashboard
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
Surface AI pipeline portal sources on the dashboard instead of a standalone page. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -92,4 +92,7 @@ export const API_ENDPOINTS = {
|
||||
CLOSING_SOON: "dashboard/closing-soon",
|
||||
RECENT: "dashboard/recent",
|
||||
},
|
||||
PORTALS: {
|
||||
GET: "ai-pipeline/scrape/portals",
|
||||
},
|
||||
} as const;
|
||||
|
||||
@@ -2,6 +2,8 @@ export * from "./companies-service";
|
||||
export * from "./dashboard-service";
|
||||
export * from "./file-service";
|
||||
export * from "./inquiries-service";
|
||||
export * from "./portals-service";
|
||||
export * from "./profile-service";
|
||||
export * from "./tenders-service";
|
||||
export * from "./user-services";
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import api from "../axios";
|
||||
import { API_ENDPOINTS } from "../endpoints";
|
||||
import { ApiResponse, PortalsListResponseSchema, TPortal } from "../types";
|
||||
|
||||
export const portalsService = {
|
||||
getPortals: async (): Promise<ApiResponse<TPortal[]>> => {
|
||||
try {
|
||||
const response = await api.get(API_ENDPOINTS.PORTALS.GET);
|
||||
return PortalsListResponseSchema.parse(response.data);
|
||||
} catch (error) {
|
||||
console.error("ERROR caught in portals service => getPortals", error);
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import { z } from "zod";
|
||||
import { createApiResponseSchema } from "./Factory";
|
||||
|
||||
export const PortalSchema = z.string();
|
||||
|
||||
export const PortalsListResponseSchema = createApiResponseSchema(
|
||||
z.array(PortalSchema),
|
||||
);
|
||||
|
||||
export type TPortal = z.infer<typeof PortalSchema>;
|
||||
export type TPortalsListResponse = z.infer<typeof PortalsListResponseSchema>;
|
||||
@@ -1,14 +1,15 @@
|
||||
export * from "./CompanyCategories";
|
||||
export * from "./CompanyDocuments";
|
||||
export * from "./Customers";
|
||||
export * from "./Dashboard";
|
||||
export * from "./Factory";
|
||||
export * from "./Feedback";
|
||||
export * from "./Posts";
|
||||
export * from "./Profile";
|
||||
export * from "./shared";
|
||||
export * from "./TCompany";
|
||||
export * from "./User";
|
||||
export * from "./TInquiries";
|
||||
export * from "./TCms";
|
||||
export * from "./Feedback";
|
||||
export * from "./TCompany";
|
||||
export * from "./Tenders";
|
||||
export * from "./Dashboard";
|
||||
export * from "./TInquiries";
|
||||
export * from "./TPortals";
|
||||
export * from "./User";
|
||||
|
||||
Reference in New Issue
Block a user