forked from trent_larson/crowd-funder-for-time-pwa
add pages to see all the offers to user and offers to user's projects
This commit is contained in:
@@ -593,17 +593,21 @@ export async function setPlanInCache(
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns { data: Array<OfferSummaryRecord>, hitLimit: boolean }
|
||||
* @returns { data: Array<OfferSummaryRecord>, hitLimit: boolean true if maximum was hit and there may be more }
|
||||
*/
|
||||
export async function getNewOffersToUser(
|
||||
axios: Axios,
|
||||
apiServer: string,
|
||||
activeDid: string,
|
||||
lastAckedOfferToUserJwtId?: string,
|
||||
afterOfferJwtId?: string,
|
||||
beforeOfferJwtId?: string,
|
||||
) {
|
||||
let url = `${apiServer}/api/v2/report/offers?recipientDid=${activeDid}`;
|
||||
if (lastAckedOfferToUserJwtId) {
|
||||
url += "&afterId=" + lastAckedOfferToUserJwtId;
|
||||
if (afterOfferJwtId) {
|
||||
url += "&afterId=" + afterOfferJwtId;
|
||||
}
|
||||
if (beforeOfferJwtId) {
|
||||
url += "&beforeId=" + beforeOfferJwtId;
|
||||
}
|
||||
const headers = await getHeaders(activeDid);
|
||||
const response = await axios.get(url, { headers });
|
||||
@@ -611,17 +615,22 @@ export async function getNewOffersToUser(
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @returns { data: Array<OfferToPlanSummaryRecord>, hitLimit: boolean }
|
||||
* @returns { data: Array<OfferToPlanSummaryRecord>, hitLimit: boolean true if maximum was hit and there may be more }
|
||||
*/
|
||||
export async function getNewOffersToUserProjects(
|
||||
axios: Axios,
|
||||
apiServer: string,
|
||||
activeDid: string,
|
||||
lastAckedOfferToUserProjectsJwtId?: string,
|
||||
afterOfferJwtId?: string,
|
||||
beforeOfferJwtId?: string,
|
||||
) {
|
||||
let url = `${apiServer}/api/v2/report/offersToPlansOwnedByMe`;
|
||||
if (lastAckedOfferToUserProjectsJwtId) {
|
||||
url += "?afterId=" + lastAckedOfferToUserProjectsJwtId;
|
||||
if (afterOfferJwtId) {
|
||||
url += "?afterId=" + afterOfferJwtId;
|
||||
}
|
||||
if (beforeOfferJwtId) {
|
||||
url += afterOfferJwtId ? "&" : "?";
|
||||
url += "beforeId=" + beforeOfferJwtId;
|
||||
}
|
||||
const headers = await getHeaders(activeDid);
|
||||
const response = await axios.get(url, { headers });
|
||||
|
||||
Reference in New Issue
Block a user