nexus-devs / NexusHub

📈 Warframe and WoW Classic Economy Analytics
https://nexushub.co
Other
92 stars 10 forks source link

Add drop location endpoint #83

Open Kaptard opened 6 years ago

Kaptard commented 6 years ago

I'm submitting a...


Current behavior

Drop locations are served with the main item data (/warframe/v1/items/:item)


Expected behavior

Should be served on separate endpoint to reduce traffic.


Minimal reproduction of the problem

Users would experience less network load and devs will have an easier time working with the data.


Environment

Browser:

For development issues:

Additional Description

jtbry commented 4 years ago

Hey, I see this issue is a bit old but if it's still required I would like to work on it! If it is free to be worked on I intend to implement it similarly to how the prices endpoint is implemented.

Proposed changes would be as such:

  1. Delete component.drops from the object on the base item API endpoint
  2. Create a new endpoint, accessible similar to how prices are, at /warframe/v1/items/:item/drops 2A. Use projection on the MongoDB Query to return only the item's components' drops and components' name.

The response from this endpoint would look like this

{
    components: [{
        name: String,
        drops: [{
            location: String,
            type: String,
            rarity: String,
            chance: Number
        }]
    }]
}