So, I’m trying to build a bidding application. Something super simple in concept, but I cannot for the life of me get the relationships to work properly.
I’ll have a user create a bid. Once a bid is created, other users should be able to bid on it.
I have everything built to create the bid and all that, but i’m stuck trying to get a bid that has not been awarded to a user to display in a list via location.
When a bid is created, the creator has to select a location, and that location is populated in the bid.
When I try to make a list of all bids that are not awarded for some reason I cant say to display the bids that has a location that is equal to the logged in users location. And keep in mine im not talking about geo locations or anything like that. These are static assigned fields.
I’m going crazy and probably over thinking something here, but any help would be appreciated!
I see that you link market location and market sub location to users, you might want to take this off first to debug to make it easier.
If the awarded user is just one, you can check if the bids>user is empty to get unawarded bids.
If you want to have another safety measure, add another boolean and update true if the bid is awarded, so you can filter unawarded bids if this boolean is false.
I think it’s simple but seems confusing; you see you have set the data so that a user can have multiple Market Locations and Sublocations, while a bid has one Sub Location and one market location; so when you try to show bids that match the user’s location; you are asking for one location to contain a list, which is not possible.