mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
save
This commit is contained in:
@@ -12,6 +12,8 @@ import { EventAttachment } from 'src/app/models/attachment.model';
|
||||
import { BadRequestPage } from '../../popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage} from '../../popover/success-message/success-message.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -45,14 +47,19 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
minDate: string;
|
||||
|
||||
loggeduser: User;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private eventService: EventsService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService
|
||||
private toastService: ToastService,
|
||||
private userService: AuthService,
|
||||
|
||||
) {}
|
||||
) {
|
||||
this.loggeduser = userService.ValidatedUser;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -173,11 +180,11 @@ export class NewEventPage implements OnInit {
|
||||
this.postEvent.HasAttachments = true;
|
||||
}
|
||||
|
||||
if(this.profile=='mdgpr') {
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).subscribe(
|
||||
async (id) => {
|
||||
|
||||
const eventId: string = id;
|
||||
const eventId: any = id;
|
||||
|
||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||
return {
|
||||
@@ -215,11 +222,13 @@ export class NewEventPage implements OnInit {
|
||||
this.toastService.badRequest('Evento não criado')
|
||||
});
|
||||
}
|
||||
else if(this.profile=='pr') {
|
||||
else if(this.loggeduser.Profile == 'PR') {
|
||||
this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).subscribe(
|
||||
(id) => {
|
||||
console.log(id);
|
||||
|
||||
|
||||
const eventId: string = id;
|
||||
const eventId: any = id;
|
||||
|
||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user