fix list of offers (and some other lists), and add tests for offers

This commit is contained in:
2024-08-12 09:25:01 -06:00
parent 8c652ab29b
commit 53e77e46dd
16 changed files with 71 additions and 28 deletions

View File

@@ -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);
}