AW-6226 Add admin function to post task on behalve of other user

This commit is contained in:
Peter Bastiani 2024-06-12 15:29:15 +02:00
parent b778e5726c
commit 71a2ef44e6

View File

@ -2,6 +2,7 @@ import { HttpClient, HttpParams } from "@angular/common/http";
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { IItem } from '../models/item';
import { IItemTask } from '../models/itemTask';
import { IUser } from '../models/user';
import { AppConfig } from "../shared/app.config";
import { ItemTypeService } from './itemtype.service';
@ -47,4 +48,8 @@ export class AdminService {
getAllUsers(): Observable<IUser[]> {
return this.httpClient.get<IUser[]>(`${this.ApiEndpoint()}/api/v1/admin/users`);
}
postItemTask(item: IItem, task: IItemTask): Observable<IItemTask> {
return this.httpClient.post<IItemTask>(`${this.ApiEndpoint()}/api/v1/admin/${item.code}/tasks`, task);
}
}