Loading web/src/core/constants/selected_panel.ts +4 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,8 @@ export enum AdminSelectedPanel { TOWN_INFO = "town_info", // Panel for town information PLACES = "places", // Panel for places POINT_OF_INTEREST = "point_of_interest" // Panel for points of interest POINT_OF_INTEREST = "point_of_interest", // Panel for points of interest ABOUT_US = "about_us" // Panel for about us } /** Loading @@ -13,5 +14,6 @@ export enum AdminSelectedPanel { export enum SuperAdminSelectedPanel { TOWNS = "towns", // Panel for towns ADMINS = "admins", // Panel for admins CATEGORIES = "categories" // Panel for categories CATEGORIES = "categories", // Panel for categories ABOUT_US = "about_us", // Panel for about us } No newline at end of file web/src/data/datasource/api/poi_datasource.ts +3 −4 Original line number Diff line number Diff line import axios from "axios"; import { Buffer } from "buffer"; import { PoiDatasourceInf } from "../poi_datasource"; import { PointOfInterest } from "./entities/poi"; import { APIUrl } from "../../../core/constants/api_url"; Loading Loading @@ -91,9 +90,9 @@ export class POIDatasourceProd implements PoiDatasourceInf { * Generates a PDF for the specified points of interest. * @param idPlace - The ID of the place. * @param pointsId - An array of point IDs to include in the PDF. * @returns A promise that resolves to a base64-encoded string of the PDF. * @returns A promise that resolves to a Blob containing the PDF data. */ async getPDFByPoints(idPlace: number, pointsId: number[]): Promise<string> { async getPDFByPoints(idPlace: number, pointsId: number[]): Promise<Blob> { const { data } = await axios.get( APIUrl + API_ROUTE_PLACE + `/${idPlace}` + API_ROUTE_POINT + "/generate", { Loading @@ -103,6 +102,6 @@ export class POIDatasourceProd implements PoiDatasourceInf { responseType: "arraybuffer", } ); return Buffer.from(data, "binary").toString("base64"); return new Blob([data], { type: "application/pdf" }); } } web/src/data/datasource/poi_datasource.ts +2 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ export interface PoiDatasourceInf { * Retrieves a PDF document containing information about specified POIs. * @param idPlace - The ID of the place. * @param pointsId - An array of POI IDs. * @returns A promise that resolves to a string representing the PDF document. * @returns A promise that resolves to a Blob containing the PDF data. */ getPDFByPoints(idPlace: number, pointsId: number[]): Promise<string>; getPDFByPoints(idPlace: number, pointsId: number[]): Promise<Blob>; } web/src/data/repository/poi_repository.ts +2 −2 Original line number Diff line number Diff line Loading @@ -39,9 +39,9 @@ export class POIRepositoryProd implements PoiRepositoryInf { * Retrieves a PDF document for the given points of interest. * @param idPlace - The ID of the place. * @param pointsId - An array of point IDs. * @returns A promise that resolves to a string representing the PDF document. * @returns A promise that resolves to a Blob containing the PDF data. */ async getPDFByPoints(idPlace: number, pointsId: number[]): Promise<string> { async getPDFByPoints(idPlace: number, pointsId: number[]): Promise<Blob> { return this.datasouce.getPDFByPoints(idPlace, pointsId); } } web/src/domain/repository/poi_repository.ts +2 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ export interface PoiRepositoryInf { * Retrieves a PDF containing information about specified POIs. * @param idPlace - The ID of the place. * @param pointsId - An array of POI IDs. * @returns A promise that resolves to a string representing the PDF. * @returns A promise that resolves to a Blob containing the PDF data. */ getPDFByPoints(idPlace: number, pointsId: number[]): Promise<string>; getPDFByPoints(idPlace: number, pointsId: number[]): Promise<Blob>; } Loading
web/src/core/constants/selected_panel.ts +4 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,8 @@ export enum AdminSelectedPanel { TOWN_INFO = "town_info", // Panel for town information PLACES = "places", // Panel for places POINT_OF_INTEREST = "point_of_interest" // Panel for points of interest POINT_OF_INTEREST = "point_of_interest", // Panel for points of interest ABOUT_US = "about_us" // Panel for about us } /** Loading @@ -13,5 +14,6 @@ export enum AdminSelectedPanel { export enum SuperAdminSelectedPanel { TOWNS = "towns", // Panel for towns ADMINS = "admins", // Panel for admins CATEGORIES = "categories" // Panel for categories CATEGORIES = "categories", // Panel for categories ABOUT_US = "about_us", // Panel for about us } No newline at end of file
web/src/data/datasource/api/poi_datasource.ts +3 −4 Original line number Diff line number Diff line import axios from "axios"; import { Buffer } from "buffer"; import { PoiDatasourceInf } from "../poi_datasource"; import { PointOfInterest } from "./entities/poi"; import { APIUrl } from "../../../core/constants/api_url"; Loading Loading @@ -91,9 +90,9 @@ export class POIDatasourceProd implements PoiDatasourceInf { * Generates a PDF for the specified points of interest. * @param idPlace - The ID of the place. * @param pointsId - An array of point IDs to include in the PDF. * @returns A promise that resolves to a base64-encoded string of the PDF. * @returns A promise that resolves to a Blob containing the PDF data. */ async getPDFByPoints(idPlace: number, pointsId: number[]): Promise<string> { async getPDFByPoints(idPlace: number, pointsId: number[]): Promise<Blob> { const { data } = await axios.get( APIUrl + API_ROUTE_PLACE + `/${idPlace}` + API_ROUTE_POINT + "/generate", { Loading @@ -103,6 +102,6 @@ export class POIDatasourceProd implements PoiDatasourceInf { responseType: "arraybuffer", } ); return Buffer.from(data, "binary").toString("base64"); return new Blob([data], { type: "application/pdf" }); } }
web/src/data/datasource/poi_datasource.ts +2 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ export interface PoiDatasourceInf { * Retrieves a PDF document containing information about specified POIs. * @param idPlace - The ID of the place. * @param pointsId - An array of POI IDs. * @returns A promise that resolves to a string representing the PDF document. * @returns A promise that resolves to a Blob containing the PDF data. */ getPDFByPoints(idPlace: number, pointsId: number[]): Promise<string>; getPDFByPoints(idPlace: number, pointsId: number[]): Promise<Blob>; }
web/src/data/repository/poi_repository.ts +2 −2 Original line number Diff line number Diff line Loading @@ -39,9 +39,9 @@ export class POIRepositoryProd implements PoiRepositoryInf { * Retrieves a PDF document for the given points of interest. * @param idPlace - The ID of the place. * @param pointsId - An array of point IDs. * @returns A promise that resolves to a string representing the PDF document. * @returns A promise that resolves to a Blob containing the PDF data. */ async getPDFByPoints(idPlace: number, pointsId: number[]): Promise<string> { async getPDFByPoints(idPlace: number, pointsId: number[]): Promise<Blob> { return this.datasouce.getPDFByPoints(idPlace, pointsId); } }
web/src/domain/repository/poi_repository.ts +2 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ export interface PoiRepositoryInf { * Retrieves a PDF containing information about specified POIs. * @param idPlace - The ID of the place. * @param pointsId - An array of POI IDs. * @returns A promise that resolves to a string representing the PDF. * @returns A promise that resolves to a Blob containing the PDF data. */ getPDFByPoints(idPlace: number, pointsId: number[]): Promise<string>; getPDFByPoints(idPlace: number, pointsId: number[]): Promise<Blob>; }