Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
RIT_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박권수
2021-08-17 10:27:16 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
35e4579c31d35b5b239b23eb9a1cdf3f23cf82f9
35e4579c
2 parents
bf442f5b
79292e9d
Merge branch 'server' into web
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
server/src/api/bottle/bottle.ctrl.js
server/src/models/bottleMedicine.js
server/src/api/bottle/bottle.ctrl.js
View file @
35e4579
...
...
@@ -269,6 +269,14 @@ exports.setMedicine = async(ctx) => {
return
;
}
//new bottleMedicine
let
bottleMedicine
=
new
BottleMedicine
({
bottleId
,
medicineId
,
dosage
,
});
if
(
doctorId
!==
undefined
&&
doctorId
!==
null
&&
doctorId
!==
''
)
{
const
patientInfo
=
await
PatientInfo
.
findByPatientIdAndDoctorIdAndUseYn
(
userId
,
doctorId
,
'Y'
);
if
(
!
patientInfo
)
{
...
...
@@ -278,14 +286,11 @@ exports.setMedicine = async(ctx) => {
};
return
;
}
bottleMedicine
.
setDoctorId
(
doctorId
);
}
const
bottleMedicine
=
new
BottleMedicine
({
bottleId
,
medicineId
,
doctorId
,
dosage
,
});
bottleMedicine
.
save
();
ctx
.
status
=
200
;
...
...
server/src/models/bottleMedicine.js
View file @
35e4579
...
...
@@ -30,5 +30,9 @@ const BottleMedicineSchema = new Schema({
}
});
BottleMedicineSchema
.
methods
.
setDoctorId
=
function
(
doctorId
)
{
this
.
doctorId
=
doctorId
;
};
module
.
exports
=
mongoose
.
model
(
'BottleMedicine'
,
BottleMedicineSchema
);
\ No newline at end of file
...
...
Please
register
or
login
to post a comment