fix(core): update

This commit is contained in:
2020-06-21 16:27:02 +00:00
parent 40704efaa4
commit 057cca6f0e
4 changed files with 69 additions and 23 deletions

View File

@@ -18,6 +18,18 @@ export interface IOraOrganization {
}
export class OraOrganization implements IOraOrganization {
// ======
// STATIC
// ======
public static async getAllOrganizations(oraRef: Ora): Promise<OraOrganization[]> {
const response = await oraRef.request('/organizations', 'GET');
const organizations: OraOrganization[] = [];
for (const orgData of response.data) {
organizations.push(new OraOrganization(oraRef, orgData));
}
return organizations;
}
public created_at: string;
public description: string;
public id: number;
@@ -31,15 +43,6 @@ export class OraOrganization implements IOraOrganization {
public updated_at: string;
public web: string;
public static async getAllOrganizations(oraRef: Ora): Promise<OraOrganization[]> {
const response = await oraRef.request('/organizations', 'GET');
const organizations: OraOrganization[] = [];
for (const orgData of response.data) {
organizations.push(new OraOrganization(oraRef, orgData));
}
return organizations;
}
// ========
// INSTANCE
// ========
@@ -50,7 +53,7 @@ export class OraOrganization implements IOraOrganization {
Object.assign(this, creationObjectArg);
}
public async getAllProjects(): Promise<OraProject[]> {
public async getProjects(): Promise<OraProject[]> {
return OraProject.getAllProjectsForOrganization(this);
}
}