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