@doctadevs/knex
Advanced tools
Comparing version 0.0.9 to 0.0.10
import { Training } from '@doctadevs/types'; | ||
export declare const getTraining: (id: string) => Promise<Training | void>; | ||
export declare const getTrainingByCohortId: (cohortId: string) => Promise<Training | void>; |
@@ -6,8 +6,8 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTraining = void 0; | ||
exports.getTrainingByCohortId = void 0; | ||
const training_1 = __importDefault(require("../transforms/training")); | ||
const database_1 = __importDefault(require("../database")); | ||
const trainingCohorts = () => database_1.default('detailed_training_cohorts_view'); | ||
const getTraining = async (id) => { | ||
const [training] = await trainingCohorts().where('id', id).limit(1).select(); | ||
const getTrainingByCohortId = async (cohortId) => { | ||
const [training] = await trainingCohorts().where('training_cohort_id', cohortId).limit(1).select(); | ||
if (!training) { | ||
@@ -18,3 +18,3 @@ return; | ||
}; | ||
exports.getTraining = getTraining; | ||
exports.getTrainingByCohortId = getTrainingByCohortId; | ||
//# sourceMappingURL=trainings.js.map |
{ | ||
"name": "@doctadevs/knex", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -8,4 +8,4 @@ import { Training } from '@doctadevs/types'; | ||
export const getTraining = async (id: string): Promise<Training | void> => { | ||
const [training] = await trainingCohorts().where('id', id).limit(1).select(); | ||
export const getTrainingByCohortId = async (cohortId: string): Promise<Training | void> => { | ||
const [training] = await trainingCohorts().where('training_cohort_id', cohortId).limit(1).select(); | ||
@@ -12,0 +12,0 @@ if (!training) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33216