-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from advanced-computer-lab-2023/VCP-9
Vcp 9 backend
- Loading branch information
Showing
5 changed files
with
70 additions
and
53 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
import PatientRepository from '../database/repository/patient-repository.js'; | ||
|
||
class PatientService { | ||
constructor() { | ||
this.repository = new PatientRepository(); | ||
} | ||
constructor() { | ||
this.repository = new PatientRepository(); | ||
} | ||
|
||
async getAllPatient() { | ||
const patients = await this.repository.findAllPatients(); | ||
return patients; | ||
} | ||
async getAllPatient() { | ||
const patients = await this.repository.findAllPatients(); | ||
return patients; | ||
} | ||
|
||
async getFamilyMembers(id) { | ||
const familyMembers = await this.repository.findFamilyMembers(id); | ||
return familyMembers; | ||
} | ||
async getFamilyMembers(id) { | ||
const familyMembers = await this.repository.findFamilyMembers(id); | ||
return familyMembers; | ||
} | ||
|
||
async addFamilyMember(id, updates) { | ||
const familyMembers = await this.repository.addFamilyMember( | ||
id, | ||
updates | ||
); | ||
return familyMembers; | ||
} | ||
async addFamilyMember(id, updates) { | ||
const familyMembers = await this.repository.addFamilyMember( | ||
id, | ||
updates | ||
); | ||
return familyMembers; | ||
} | ||
} | ||
|
||
export default PatientService; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import mongoose from 'mongoose'; | ||
|
||
export const isValidMongoId = (id) => { | ||
return mongoose.Types.ObjectId.isValid(id); | ||
return mongoose.Types.ObjectId.isValid(id); | ||
}; |