add new projects to front page

This commit is contained in:
2024-11-04 19:57:39 -07:00
parent 5f452dcf73
commit 195ba6c759
5 changed files with 193 additions and 20 deletions

View File

@@ -112,6 +112,10 @@ export interface OfferSummaryRecord {
validThrough: string;
}
export interface OfferToPlanSummaryRecord extends OfferSummaryRecord {
planName: string;
}
// a summary record; the VC is not currently part of this record
export interface PlanSummaryRecord {
agentDid?: string; // optional, if the issuer wants someone else to manage as well
@@ -603,6 +607,22 @@ export async function getNewOffersToUser(
return offers;
}
export async function getNewOffersToUserProjects(
axios: Axios,
apiServer: string,
activeDid: string,
lastAckedOfferToUserProjectsJwtId?: string,
) {
let url = `${apiServer}/api/v2/report/offersToPlansOwnedByMe`;
if (lastAckedOfferToUserProjectsJwtId) {
url += "?afterId=" + lastAckedOfferToUserProjectsJwtId;
}
const headers = await getHeaders(activeDid);
const response = await axios.get(url, { headers });
const offers = response.data.data;
return offers;
}
/**
* Construct GiveAction VC for submission to server
*