-
-
Save parzibyte/b5e0c443db5bab25a137c01ab3bb4f4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import db from "@/BaseDeDatos"; | |
import Utiles from "@/Utiles"; | |
import Constantes from "@/Constantes"; | |
import HorariosService from "@/HorariosService"; | |
const RutasService = { | |
async nueva(nombre) { | |
return await db.put({ | |
_id: Utiles.idConSufijo(Constantes.PREFIJO_RUTAS), | |
nombre | |
}); | |
}, | |
async obtener() { | |
const rutas = await db.find({ | |
selector: { | |
_id: { | |
$gte: Constantes.PREFIJO_RUTAS, | |
$lte: Constantes.PREFIJO_RUTAS + "\ufff0", | |
} | |
} | |
}); | |
return rutas.docs; | |
}, | |
async eliminar(documento) { | |
await HorariosService.eliminarDeRuta(documento._id); | |
return await db.remove(documento); | |
} | |
}; | |
export default RutasService; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment