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 offers = await this.models.OfferCreated.findAll({
|
||||
const activeOffers = await this.models.OfferCreated.findAll({
|
||||
where: {
|
||||
public_key: publicKey,
|
||||
'$OfferDeleted.uuid$': null,
|
||||
},
|
||||
include: { model: this.models.OfferDeleted, required: false },
|
||||
});
|
||||
|
||||
console.log(offers);
|
||||
console.log(activeOffers);
|
||||
|
||||
if (!offers) {
|
||||
if (!activeOffers) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const offersToReturn = [];
|
||||
if (offers) {
|
||||
for (const someOffer of offers) {
|
||||
if (activeOffers) {
|
||||
for (const someOffer of activeOffers) {
|
||||
const offerDetails = await this.models.OfferDetailsSet.findOne({
|
||||
where: {
|
||||
offer_uuid: someOffer.uuid,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue