diff --git a/app/meteor/imports/api/clients/actions/register.js b/app/meteor/imports/api/clients/actions/register.js
index f3d0dd2c6..d17fe16a6 100644
--- a/app/meteor/imports/api/clients/actions/register.js
+++ b/app/meteor/imports/api/clients/actions/register.js
@@ -1,19 +1,16 @@
-import { ValidatedMethod } from 'meteor/mdg:validated-method'
-import { SimpleSchema } from 'meteor/aldeed:simple-schema'
-import { CallPromiseMixin } from 'meteor/didericis:callpromise-mixin'
import { Settings } from '../../settings'
import { Events } from '../../events'
+import { action } from '../../../util/meteor/action'
-export const register = ({ Clients }) => {
- return new ValidatedMethod({
+export const register = ({ Clients }) =>
+ action({
name: 'clients/register',
- mixins: [CallPromiseMixin],
- validate: new SimpleSchema({
- clientKey: { type: String, min: 200 },
- systemInfo: { type: Object, blackbox: true }
- }).validator(),
-
- run ({ clientKey, systemInfo }) {
+ args: {
+ clientKey: String,
+ systemInfo: Object
+ },
+ allowAnonymous: true,
+ fn ({ clientKey, systemInfo }) {
if (this.isSimulation) {
return { isOk: true }
}
@@ -50,4 +47,3 @@ export const register = ({ Clients }) => {
}
}
})
-}
diff --git a/app/meteor/imports/client/patientAppointments/Consents.js b/app/meteor/imports/client/patientAppointments/Consents.js
index bc6f83225..dcf1b6a3d 100644
--- a/app/meteor/imports/client/patientAppointments/Consents.js
+++ b/app/meteor/imports/client/patientAppointments/Consents.js
@@ -117,12 +117,12 @@ export const Popover = withTracker(composer)(({
scan({ mediaTag, patientId, appointmentId })
}
- const handleSelectPastAppointmentConsent = appointmentId => {
+ const handleSelectPastAppointmentConsent = pastAppointmentId => {
const pastAppointment = Appointments.findOne({ _id:
- appointmentId })
+ pastAppointmentId })
if (!pastAppointment) {
- throw new Error(`handleSelectPastAppointmentConsent: Cannot find past appointment with id ${appointmentId}`)
+ throw new Error(`handleSelectPastAppointmentConsent: Cannot find past appointment with id ${pastAppointmentId}`)
}
const consentMediaIds = uniq([
@@ -177,7 +177,7 @@ export const Popover = withTracker(composer)(({
edge='start' />
- {moment(a.start).format(__('time.dateFormat'))}
+ {JSON.stringify(a.consentMedias.map(m => m._id))} + {JSON.stringify(appointment.consentMediaIds)} {moment(a.start).format(__('time.dateFormat'))}