now only active offers are shown
This commit is contained in:
parent
613ded0cf1
commit
9c4581d33d
1 changed files with 7 additions and 5 deletions
|
|
@ -54,21 +54,23 @@ class OfferServiceProvider {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getOffersByPublicKey = async (publicKey) => {
|
const getOffersByPublicKey = async (publicKey) => {
|
||||||
const offers = await this.models.OfferCreated.findAll({
|
const activeOffers = await this.models.OfferCreated.findAll({
|
||||||
where: {
|
where: {
|
||||||
public_key: publicKey,
|
public_key: publicKey,
|
||||||
|
'$OfferDeleted.uuid$': null,
|
||||||
},
|
},
|
||||||
|
include: { model: this.models.OfferDeleted, required: false },
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(offers);
|
console.log(activeOffers);
|
||||||
|
|
||||||
if (!offers) {
|
if (!activeOffers) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const offersToReturn = [];
|
const offersToReturn = [];
|
||||||
if (offers) {
|
if (activeOffers) {
|
||||||
for (const someOffer of offers) {
|
for (const someOffer of activeOffers) {
|
||||||
const offerDetails = await this.models.OfferDetailsSet.findOne({
|
const offerDetails = await this.models.OfferDetailsSet.findOne({
|
||||||
where: {
|
where: {
|
||||||
offer_uuid: someOffer.uuid,
|
offer_uuid: someOffer.uuid,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue