fix(core): update
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import * as plugins from './ora.plugins';
|
||||
import { Ora } from './ora.classes.ora';
|
||||
import { OraOrganization } from './ora.classes.organization';
|
||||
import { OraList } from './ora.classes.list';
|
||||
|
||||
export interface IOraProject {
|
||||
archived: boolean;
|
||||
@@ -29,6 +30,24 @@ export interface IOraProject {
|
||||
}
|
||||
|
||||
export class OraProject implements IOraProject {
|
||||
// ======
|
||||
// STATIC
|
||||
// ======
|
||||
public static async getAllProjectsForOrganization(oraOrganizationRef: OraOrganization) {
|
||||
const response = await oraOrganizationRef.oraRef.request('/projects', 'GET');
|
||||
const projects: OraProject[] = [];
|
||||
for (const projectData of response.data) {
|
||||
const oraProject = new OraProject(oraOrganizationRef, projectData);
|
||||
if (oraProject.organization_id === oraOrganizationRef.id) {
|
||||
projects.push(oraProject);
|
||||
}
|
||||
}
|
||||
return projects;
|
||||
}
|
||||
|
||||
// ========
|
||||
// INSTANCE
|
||||
// ========
|
||||
public archived: boolean;
|
||||
public comment_all: number;
|
||||
public commits_visibility: number;
|
||||
@@ -60,15 +79,7 @@ export class OraProject implements IOraProject {
|
||||
Object.assign(this, creationObjectArg);
|
||||
}
|
||||
|
||||
public static async getAllProjectsForOrganization(oraOrganizationRef: OraOrganization) {
|
||||
const response = await oraOrganizationRef.oraRef.request('/projects', 'GET');
|
||||
const projects: OraProject[] = [];
|
||||
for (const projectData of response.data) {
|
||||
const oraProject = new OraProject(oraOrganizationRef, projectData);
|
||||
if (oraProject.organization_id === oraOrganizationRef.id) {
|
||||
projects.push(oraProject);
|
||||
}
|
||||
}
|
||||
return projects;
|
||||
public async getLists(): Promise<OraList[]> {
|
||||
return OraList.getAllLists(this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user