31 lines
698 B
TypeScript
31 lines
698 B
TypeScript
import axios from "axios";
|
|
import type {Artifact} from "~/components/artifact/Artifact";
|
|
|
|
export class Group
|
|
{
|
|
constructor(
|
|
public id: string,
|
|
public groupId: string,
|
|
public artifacts: Artifact[]
|
|
)
|
|
{
|
|
}
|
|
|
|
static get(onSuccess: (groups: Group[]) => void)
|
|
{
|
|
MavenApi.create().get<Group[]>("/groups")
|
|
.then((response) =>
|
|
{
|
|
onSuccess(response.data)
|
|
});
|
|
}
|
|
|
|
static getById(id: string, onSuccess: (group: Group) => void)
|
|
{
|
|
MavenApi.create().get<Group>("/groups/" + id)
|
|
.then((response) =>
|
|
{
|
|
onSuccess(response.data)
|
|
});
|
|
}
|
|
} |