forked from trent_larson/crowd-funder-for-time-pwa
Added loading settings (no image yet) plus refactored types a little more.
This commit is contained in:
@@ -139,13 +139,9 @@ interface ProjectData {
|
||||
})
|
||||
export default class ProjectsView extends Vue {
|
||||
apiServer = "";
|
||||
projects: {
|
||||
handleId: string;
|
||||
name: string;
|
||||
description: string;
|
||||
rowid: number;
|
||||
}[] = [];
|
||||
projects: ProjectData[] = [];
|
||||
current: IIdentifier;
|
||||
isLoading = false;
|
||||
|
||||
/**
|
||||
* Core project data loader
|
||||
@@ -159,6 +155,7 @@ export default class ProjectsView extends Vue {
|
||||
};
|
||||
|
||||
try {
|
||||
this.isLoading = true;
|
||||
const resp = await this.axios.get(url, { headers });
|
||||
if (resp.status === 200) {
|
||||
const plans: ProjectData[] = resp.data.data;
|
||||
@@ -169,6 +166,8 @@ export default class ProjectsView extends Vue {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Got error loading projects:", error);
|
||||
} finally {
|
||||
this.isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,6 +176,7 @@ export default class ProjectsView extends Vue {
|
||||
* @param payload is the flag from the InfiniteScroll indicating if it should load
|
||||
**/
|
||||
async loadMoreData(payload: boolean) {
|
||||
console.log(payload);
|
||||
if (this.projects.length > 0) {
|
||||
const latestProject = this.projects[this.projects.length - 1];
|
||||
const url = `${this.apiServer}/api/v2/report/plansByIssuer?beforeId=${latestProject.rowid}`;
|
||||
|
||||
Reference in New Issue
Block a user