27 lines
648 B
JavaScript
27 lines
648 B
JavaScript
|
|
import { paramyxRunQuery } from '../paramyxConnection.js';
|
||
|
|
import { medicationHelpers } from './helpers/medications.js'
|
||
|
|
|
||
|
|
const getMedications = async () => {
|
||
|
|
try {
|
||
|
|
const dataResp = await paramyxRunQuery('SELECT * FROM medications');
|
||
|
|
return dataResp;
|
||
|
|
} catch (err) {
|
||
|
|
console.log('GET MEDICATIONS ERROR: ', err);
|
||
|
|
throw err;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
const getBaseMedications = async () => {
|
||
|
|
try {
|
||
|
|
const dataResp = medicationHelpers.getBaseMedications();
|
||
|
|
return dataResp;
|
||
|
|
} catch (err) {
|
||
|
|
console.log('GET MEDICATIONS ERROR: ', err);
|
||
|
|
throw err;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
export const medicationOperations = {
|
||
|
|
getMedications,
|
||
|
|
getBaseMedications
|
||
|
|
}
|