Bug fix in extractEventFromNote with minimum Note
This commit is contained in:
parent
a4c726498b
commit
bcbc261e3b
|
@ -41,15 +41,19 @@ export class ApEventService {
|
||||||
throw new Error('invalid type');
|
throw new Error('invalid type');
|
||||||
}
|
}
|
||||||
|
|
||||||
const title = note.name!;
|
if (note.name && note.startTime) {
|
||||||
const start = note.startTime!;
|
const title = note.name;
|
||||||
const end = note.endTime ?? null;
|
const start = note.startTime;
|
||||||
|
const end = note.endTime ?? null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title,
|
title,
|
||||||
start,
|
start,
|
||||||
end,
|
end,
|
||||||
metadata: {},
|
metadata: {},
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
throw new Error('Invalid event properties')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue