Skip to content
Snippets Groups Projects
Commit 3873eb22 authored by Bernard Roland (Student Com20)'s avatar Bernard Roland (Student Com20)
Browse files

Implemented a new adapter method for the new API path

parent 85d4d7e0
Branches
Tags
No related merge requests found
import { executeApiGet, executeApiPost, executeApiPut } from './util';
import { Task } from './task';
import { User } from './user';
import { AssignedUser } from './user';
import { Work } from './work';
export interface Project {
......@@ -14,10 +14,6 @@ export interface Project {
teams: Array<string>;
}
export interface AssignedUser extends User {
time: number;
}
export type ReducedProject = Exclude<Project, 'teams'>;
export function getProjects(): Promise<ReducedProject[]> {
......
......@@ -2,6 +2,7 @@
import { executeApiGet, executeApiPost, executeApiPut } from './util';
import { Comment } from './comment';
import { Work } from './work';
import { AssignedUser } from './user';
export interface TaskRequirement {
role: string;
......@@ -77,6 +78,10 @@ export function getTaskWork(uuid: string): Promise<Work[]> {
})), "Failed to get task work");
}
export function getTaskAssignees(uuid: string): Promise<AssignedUser[]> {
return executeApiGet(`task/${uuid}/assigned`, ({ assigned }) => assigned, "Failed to get task assignees");
}
interface AddTaskBody {
project: string;
name: string;
......
......@@ -12,6 +12,10 @@ export interface User {
email?: string;
}
export interface AssignedUser extends User {
time: number;
}
export async function exists(username: string) {
try {
const response = await fetch(`${apiRoot}/user/name/${username}`);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment