forked from jsnbuchanan/crowd-funder-for-time-pwa
fix list of offers (and some other lists), and add tests for offers
This commit is contained in:
@@ -396,7 +396,7 @@ export default class ProjectsView extends Vue {
|
||||
* @param token Authorization token
|
||||
**/
|
||||
async offerDataLoader(url: string) {
|
||||
const headers = getHeaders(this.activeDid);
|
||||
const headers = await getHeaders(this.activeDid);
|
||||
|
||||
try {
|
||||
this.isLoading = true;
|
||||
@@ -443,7 +443,7 @@ export default class ProjectsView extends Vue {
|
||||
async loadMoreOfferData(payload: boolean) {
|
||||
if (this.offers.length > 0 && payload) {
|
||||
const latestOffer = this.offers[this.offers.length - 1];
|
||||
await this.loadOffers(this.activeDid, `&beforeId=${latestOffer.jwtId}`);
|
||||
await this.loadOffers(`&beforeId=${latestOffer.jwtId}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,8 +452,8 @@ export default class ProjectsView extends Vue {
|
||||
* @param issuerDid of the user
|
||||
* @param urlExtra additional url parameters in a string
|
||||
**/
|
||||
async loadOffers(issuerDid?: string, urlExtra: string = "") {
|
||||
const url = `${this.apiServer}/api/v2/report/offers?offeredByDid=${issuerDid}${urlExtra}`;
|
||||
async loadOffers(urlExtra: string = "") {
|
||||
const url = `${this.apiServer}/api/v2/report/offers?offeredByDid=${this.activeDid}${urlExtra}`;
|
||||
await this.offerDataLoader(url);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user