calendar fixes
This commit is contained in:
parent
136da08b70
commit
8c597fd68d
8 changed files with 70 additions and 27 deletions
|
@ -69,19 +69,21 @@ export async function getCalendarTypeById(req: Request, res: Response): Promise<
|
|||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function createCalendarItem(req: Request, res: Response): Promise<any> {
|
||||
const date = req.body.date;
|
||||
const starttime = req.body.starttime;
|
||||
const endtime = req.body.endtime;
|
||||
const title = req.body.title;
|
||||
const content = req.body.content;
|
||||
const location = req.body.location;
|
||||
const allDay = req.body.allDay;
|
||||
const typeId = req.body.typeId;
|
||||
|
||||
let createItem: CreateCalendarCommand = {
|
||||
date,
|
||||
starttime,
|
||||
endtime,
|
||||
title,
|
||||
content,
|
||||
location,
|
||||
allDay,
|
||||
typeId,
|
||||
};
|
||||
let id = await CalendarCommandHandler.create(createItem);
|
||||
|
@ -117,21 +119,23 @@ export async function createCalendarType(req: Request, res: Response): Promise<a
|
|||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function updateCalendarItem(req: Request, res: Response): Promise<any> {
|
||||
const id = parseInt(req.params.id);
|
||||
const date = req.body.date;
|
||||
const id = req.params.id;
|
||||
const starttime = req.body.starttime;
|
||||
const endtime = req.body.endtime;
|
||||
const title = req.body.title;
|
||||
const content = req.body.content;
|
||||
const location = req.body.location;
|
||||
const allDay = req.body.allDay;
|
||||
const typeId = req.body.typeId;
|
||||
|
||||
let updateItem: UpdateCalendarCommand = {
|
||||
id,
|
||||
date,
|
||||
starttime,
|
||||
endtime,
|
||||
title,
|
||||
content,
|
||||
location,
|
||||
allDay,
|
||||
typeId,
|
||||
};
|
||||
await CalendarCommandHandler.update(updateItem);
|
||||
|
@ -169,7 +173,7 @@ export async function updateCalendarType(req: Request, res: Response): Promise<a
|
|||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function deleteCalendarItem(req: Request, res: Response): Promise<any> {
|
||||
const id = parseInt(req.params.id);
|
||||
const id = req.params.id;
|
||||
|
||||
let deleteItem: DeleteCalendarCommand = {
|
||||
id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue