upd
This commit is contained in:
@@ -24,17 +24,8 @@ const scheduledSessionSchema = new Schema(
|
||||
type: Date,
|
||||
required: true,
|
||||
},
|
||||
clientName: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
clientPhone: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
clientEmail: {
|
||||
type: String,
|
||||
required: true,
|
||||
client: {
|
||||
type: Object,
|
||||
},
|
||||
activeSessionId: {
|
||||
type: Schema.Types.ObjectId,
|
||||
|
||||
@@ -79,11 +79,11 @@ scheduledSessionsRouter.get("/:buildId", async (req, res) => {
|
||||
scheduledSessionsRouter.post("/", async (req, res) => {
|
||||
const { buildId, startAt, client } = req.body;
|
||||
|
||||
if (!buildId || !startAt || !client) {
|
||||
if (!buildId || !startAt) {
|
||||
return res.json({
|
||||
status: "error",
|
||||
message:
|
||||
"Parameters `compamyId`, `buildId`, `startAt`, `client` are required!", // Параметры `compamyId`, `buildId`, `startAt`, `client` обязательны!
|
||||
"Parameters `buildId`, `startAt` are required!", // Параметры `compamyId`, `buildId`, `startAt`, `client` обязательны!
|
||||
});
|
||||
}
|
||||
|
||||
@@ -156,14 +156,15 @@ scheduledSessionsRouter.post("/", async (req, res) => {
|
||||
|
||||
const scheduledSession = await ScheduledSession.create({
|
||||
buildId,
|
||||
client,
|
||||
startAt: startAtISO,
|
||||
endAt: endAtISO,
|
||||
clientName: client.name,
|
||||
clientEmail: client.email,
|
||||
clientPhone: client.phone,
|
||||
});
|
||||
|
||||
res.json({ status: "success", scheduledSession });
|
||||
res.json({
|
||||
status: "success",
|
||||
url: `https://stream.graff.tech/scheduled/${scheduledSession.id}`,
|
||||
});
|
||||
});
|
||||
|
||||
scheduledSessionsRouter.put("/:id", async (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user