Commit d04fba8a authored by Lorenzo Trujillo Rojas's avatar Lorenzo Trujillo Rojas
Browse files

Merge branch 'main' into 'main'

Se creo la sección Sobre Nosotros y se soluciono errores.

See merge request !101
parents 6c3b67c3 3c4a935c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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
}

/**
@@ -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
+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";
@@ -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",
      {
@@ -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" });
  }
}
+2 −2
Original line number Diff line number Diff line
@@ -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>;
}
+2 −2
Original line number Diff line number Diff line
@@ -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);
  }
}
+2 −2
Original line number Diff line number Diff line
@@ -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