fixed imports and exports
This commit is contained in:
parent
cb4079843c
commit
29036d14a8
|
|
@ -4,12 +4,12 @@ import {
|
|||
insertCoordinatesModel,
|
||||
modifyCoordinatesModel,
|
||||
softDeleteCoordinatesModel
|
||||
} from "../../models/resource_types/coordinatesModel";
|
||||
import { error404 } from "../../utils/errors";
|
||||
import { sendResponseNotFound } from "../../utils/responses";
|
||||
import { noResults } from "../../validators/result-validators";
|
||||
} from "../../models/resource_types/coordinatesModel.js";
|
||||
import { error404 } from "../../utils/errors.js"
|
||||
import { sendResponseNotFound } from "../../utils/responses.js";
|
||||
import { noResults } from "../../validators/result-validators.js";
|
||||
import mysql from "../../adapters/mysql.js";
|
||||
import { errorHandler } from "../../utils/errors";
|
||||
import { errorHandler } from "../../utils/errors.js";
|
||||
|
||||
const getCoordinatesListController = (req, res, next, config) => {
|
||||
const conn = mysql.start(config)
|
||||
|
|
|
|||
|
|
@ -4,9 +4,8 @@ import {
|
|||
insertPlaceModel,
|
||||
modifyPlaceModel,
|
||||
deletePlaceModel
|
||||
} from "../../models/resource_types/placesModel";
|
||||
} from "../../models/resource_types/placesModel.js";
|
||||
import { error404 } from "../../utils/errors.js"
|
||||
import { sendResponseNotFound } from "../../utils/responses.js"
|
||||
import { noResults } from "../../validators/result-validators.js"
|
||||
import mysql from "../../adapters/mysql.js"
|
||||
import { errorHandler } from "../../utils/errors.js"
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import { noResults } from "../../validators/result-validators.js";
|
|||
import {
|
||||
getReportTypesListModel,
|
||||
countReportTypesListModel,
|
||||
insertReportTypesListModel,
|
||||
modifyReportTypesListModel,
|
||||
softDeleteReportTypesListModel
|
||||
insertReportTypesModel,
|
||||
modifyReportTypesModel,
|
||||
softDeleteReportTypesModel
|
||||
} from "../../models/resource_types/reportTypesModel.js";
|
||||
|
||||
const getReportTypesListController = (req, res, next, config) => {
|
||||
|
|
@ -69,7 +69,7 @@ const postReportTypesController = (req, res, next, config) => {
|
|||
const conn = mysql.start(config);
|
||||
const created_by = req.auth.user || null
|
||||
|
||||
insertReportTypesListModel({ ...req.body, created_by, conn })
|
||||
insertReportTypesModel({ ...req.body, created_by, conn })
|
||||
.then((response) => {
|
||||
const result = {
|
||||
_data: {
|
||||
|
|
@ -91,7 +91,7 @@ const putReportTypesController = (req, res, next, config) => {
|
|||
const conn = mysql.start(config);
|
||||
const uuid_report_type = req.params.uuid;
|
||||
|
||||
modifyReportTypesListModel({ ...req.body, uuid: uuid_report_type, conn })
|
||||
modifyReportTypesModel({ ...req.body, uuid: uuid_report_type, conn })
|
||||
.then((response) => {
|
||||
const result = {
|
||||
_data: {
|
||||
|
|
@ -114,7 +114,7 @@ const softDeleteReportTypesController = (req, res, next, config) => {
|
|||
const uuid_report_type = req.params.uuid;
|
||||
const deleted_by = req.auth.user || null
|
||||
|
||||
softDeleteReportTypesListModel({ uuid: uuid_report_type, deleted_by, conn })
|
||||
softDeleteReportTypesModel({ uuid: uuid_report_type, deleted_by, conn })
|
||||
.then(() => {
|
||||
const result = {}
|
||||
next(result);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import {
|
|||
insertUserHasPlacesModel,
|
||||
modifyUserHasPlacesModel,
|
||||
softDeleteUserHasPlacesModel
|
||||
} from "../../models/resource_types/usersHasPlacesModel";
|
||||
} from "../../models/resource_types/usersHasPlacesModel.js";
|
||||
import { error404 } from "../../utils/errors.js"
|
||||
import { sendResponseNotFound } from "../../utils/responses.js"
|
||||
import { noResults } from "../../validators/result-validators.js"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import {
|
|||
insertCoordinatesQuery,
|
||||
updateCoordinatesQuery,
|
||||
softDeleteCoordinatesQuery
|
||||
} from "../../repositories/resource_types/coordinatesRepository";
|
||||
} from "../../repositories/resource_types/coordinatesRepository.js";
|
||||
import { randomUUID as uuidv4 } from 'node:crypto'
|
||||
import dayjs from 'dayjs'
|
||||
import mysql from '../../adapters/mysql.js'
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import {
|
|||
insertPlaceQuery,
|
||||
updatePlaceQuery,
|
||||
deletePlaceQuery
|
||||
} from "../../repositories/resource_types/placesRepository";
|
||||
} from "../../repositories/resource_types/placesRepository.js";
|
||||
import { randomUUID as uuidv4 } from 'node:crypto'
|
||||
import dayjs from 'dayjs'
|
||||
import mysql from '../../adapters/mysql.js'
|
||||
|
|
@ -56,7 +56,6 @@ const deletePlaceModel = ({uuid, deleted, deletedBy, conn}) => {
|
|||
export {
|
||||
getPlaceListModel,
|
||||
countPlaceListModel,
|
||||
getPlaceByUuidModel,
|
||||
insertPlaceModel,
|
||||
modifyPlaceModel,
|
||||
deletePlaceModel
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import {
|
|||
insertReportTypesQuery,
|
||||
updateReportTypesQuery,
|
||||
softDeleteReportTypesQuery,
|
||||
} from "../../repositories/resource_types/reportTypesRepository";
|
||||
} from "../../repositories/resource_types/reportTypesRepository.js";
|
||||
import { randomUUID as uuidv4 } from 'node:crypto'
|
||||
import dayjs from 'dayjs'
|
||||
import mysql from '../../adapters/mysql.js'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { getUserHasPlacesListQuery, countUserHasPlacesListQuery, insertUserHasPlacesQuery, modifyUserHasPlacesQuery, softDeleteUserHasPlacesQuery
|
||||
} from "../../repositories/resource_types/usersHasPlacesRepository";
|
||||
} from "../../repositories/resource_types/usersHasPlacesRepository.js";
|
||||
import { randomUUID as uuidv4 } from 'node:crypto'
|
||||
import dayjs from 'dayjs'
|
||||
import mysql from '../../adapters/mysql.js'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { pagination } from "../../utils/pagination";
|
||||
import { pagination } from "../../utils/pagination.js";
|
||||
|
||||
const _coordinatesSelectQuery = (_pagination = '') => ({ count }) => ({ uuid, latitude, longitude }) => {
|
||||
const uuidCondition = uuid ? 'AND c.uuid = :uuid ' : '';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { pagination } from "../../utils/pagination";
|
||||
import { pagination } from "../../utils/pagination.js";
|
||||
|
||||
const _coordinatesSelectQuery = (_pagination = '') => ({ count }) => ({ uuid, name }) => {
|
||||
const uuidCondition = uuid ? 'AND rt.uuid = :uuid ' : '';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { pagination } from "../../utils/pagination";
|
||||
import { pagination } from "../../utils/pagination.js";
|
||||
//reports repository
|
||||
const _userHasPlacesSelectQuery = (_pagination = '') => ({ count }) => ({ uuid, uuidUser, uuidPlace, uuidReportType }) => {
|
||||
const uuidCondition = uuid ? 'AND up.uuid = :uuid ' : '';
|
||||
|
|
|
|||
Loading…
Reference in New Issue