@doctadevs/knex
Advanced tools
Comparing version 0.0.41 to 0.0.42
import { Training, TrainingTypeEnum } from '@doctadevs/types'; | ||
export declare const trainingCohortExists: (cohortId: string) => Promise<boolean>; | ||
export declare const getTrainingByCohortId: (cohortId: string) => Promise<Training | void>; | ||
@@ -3,0 +4,0 @@ export declare const getTrainings: () => Promise<Training[]>; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTrainingSlugsList = exports.trainingCohortHasAvailableSeats = exports.getTrainingCohortAvailableSeats = exports.getTrainingByCurrentCohortAndSlug = exports.getTrainingByCurrentCohort = exports.getTrainingsByType = exports.getTrainings = exports.getTrainingByCohortId = void 0; | ||
exports.getTrainingSlugsList = exports.trainingCohortHasAvailableSeats = exports.getTrainingCohortAvailableSeats = exports.getTrainingByCurrentCohortAndSlug = exports.getTrainingByCurrentCohort = exports.getTrainingsByType = exports.getTrainings = exports.getTrainingByCohortId = exports.trainingCohortExists = void 0; | ||
const types_1 = require("@doctadevs/types"); | ||
@@ -20,2 +20,7 @@ const training_1 = __importDefault(require("../transforms/training")); | ||
const activeTrainingSlugsList = (trainingType) => database_1.default(trainingTypeToSlugListView[trainingType]); | ||
const trainingCohortExists = async (cohortId) => { | ||
const trainings = await trainingCohorts().where('training_cohort-id', cohortId).select(); | ||
return trainings.length === 1; | ||
}; | ||
exports.trainingCohortExists = trainingCohortExists; | ||
const getTrainingByCohortId = async (cohortId) => { | ||
@@ -22,0 +27,0 @@ const trainings = await trainingCohorts().where('training_cohort_id', cohortId).select(); |
{ | ||
"name": "@doctadevs/knex", | ||
"version": "0.0.41", | ||
"version": "0.0.42", | ||
"main": "dist/index.js", | ||
@@ -33,3 +33,3 @@ "types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@doctadevs/types": "^0.0.45", | ||
"@doctadevs/types": "^0.0.47", | ||
"@doctadevs/utils": "^0.0.24", | ||
@@ -36,0 +36,0 @@ "knex": "^0.95.6", |
@@ -18,2 +18,8 @@ import { Training, TrainingTypeEnum, TrainingTypes } from '@doctadevs/types'; | ||
export const trainingCohortExists = async (cohortId: string): Promise<boolean> => { | ||
const trainings = await trainingCohorts().where('training_cohort-id', cohortId).select(); | ||
return trainings.length === 1; | ||
}; | ||
export const getTrainingByCohortId = async (cohortId: string): Promise<Training | void> => { | ||
@@ -20,0 +26,0 @@ const trainings = await trainingCohorts().where('training_cohort_id', cohortId).select(); |
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
84015
1532
+ Added@doctadevs/types@0.0.47(transitive)
- Removed@doctadevs/types@0.0.45(transitive)
Updated@doctadevs/types@^0.0.47