This commit is contained in:
Peter Maquiran
2021-08-20 12:02:27 +01:00
parent edb1a5c9d9
commit 375eeda2ca
31 changed files with 258 additions and 166 deletions
+33
View File
@@ -0,0 +1,33 @@
import { Injectable } from '@angular/core';
import { PermissionService } from 'src/app/OtherService/permission.service';
import { AttachmentsService } from '../attachments.service';
import { EventsService } from '../events.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)
}
}