Create Appointment works

This commit is contained in:
Riccardo
2021-01-06 11:09:19 +01:00
parent 07cbbf12de
commit f25a3055e5
10 changed files with 150 additions and 76 deletions

View File

@@ -9,11 +9,11 @@ const AppointmentSchema = new Schema({
type: String,
required: false
},
timeStart: {
start: {
type: Date,
required: true
},
timeEnd: {
end: {
type: Date,
required: true
},

View File

@@ -97,10 +97,8 @@ export const resolvers = {
// };
// },
async createAppointment(root, {
input
}) {
return await Appointment.create(input);
async createAppointment(parent, args, context, info) {
return await Appointment.create(args);
},
async updateAppointment(root, {
_id,

View File

@@ -20,7 +20,11 @@ type Feed {
type Mutation {
createAppointment(
input: AppointmentInput
title: String!
description: String!
start: String!
end: String!
# input: AppointmentInput
): Appointment!
updateAppointment(
_id: ID!,
@@ -82,8 +86,8 @@ type Appointment {
_id: ID!
title: String!
description: String!
timeStart: Time!
timeEnd: Time!
start: Time!
end: Time!
deleted: Boolean
# createdBy: User
# follows: [Follow!]!
@@ -92,8 +96,8 @@ type Appointment {
input AppointmentInput {
title: String!
description: String!
timeStart: Time!
timeEnd: Time!
start: Time!
end: Time!
}
input AppointmentOrderByInput {
description: Sort