Files
doneit-web/src/app/services/rules/event.service.ts
T
Peter Maquiran 7364277d95 Fix
2021-09-30 15:56:04 +01:00

36 lines
777 B
TypeScript

import { Injectable } from '@angular/core';
import { AttachmentsService } from '../attachments.service';
import { EventsService } from '../events.service';
import { PermissionService } from '../worker/permission.service';
@Injectable({
providedIn: 'root'
})
export class EventService {
constructor(
private eventService: EventsService,
public p: PermissionService,
private attachmentsService: AttachmentsService,
) { }
create({body, calendar}) {
if(this.p.userRole(['PR'])) {
return this.eventService.postEventPr(body, calendar)
} else {
return this.eventService.postEventMd(body, calendar)
}
}
addAttachment(attachment: addAttachment) {
return this.attachmentsService.setEventAttachmentById(attachment)
}
}