mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
[WIP] shops + market gear api (#8980)
* lock other classes gear * fix avatar in equip-gear-modal * fix seasonal shop * seasonal : new gear type order * fix pin gear (and get new gear on buying) * API: /shops/market-gear - refactoring pinnedGearUtils - move _isPinned to common/libs * use shops.getMarketGearCategories to list the marketGear * use shops.getMarketCategories instead of API-call * mark gear reward items as locked * purchase time-travelers stuff + update view + use method instead of http-api + add missing mammoth shop image * Time Travelers Shop: open/closed state * time travelers: show gear preview + hide sidebar if closed * update resized images * fix lint
This commit is contained in:
@@ -31,6 +31,29 @@ api.getMarketItems = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @apiIgnore
|
||||
* @api {get} /api/v3/shops/market-gear get the available gear for the market
|
||||
* @apiName GetMarketGear
|
||||
* @apiGroup Shops
|
||||
*
|
||||
* @apiSuccess {Object} data List of available gear
|
||||
*/
|
||||
api.getMarketGear = {
|
||||
method: 'GET',
|
||||
url: '/shops/market-gear',
|
||||
middlewares: [authWithHeaders()],
|
||||
async handler (req, res) {
|
||||
let user = res.locals.user;
|
||||
|
||||
let resObject = {
|
||||
categories: shops.getMarketGearCategories(user, req.language),
|
||||
};
|
||||
|
||||
res.respond(200, resObject);
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @apiIgnore
|
||||
* @api {get} /api/v3/shops/quests get the available items for the quests shop
|
||||
@@ -109,6 +132,7 @@ api.getSeasonalShopItems = {
|
||||
text: res.t('seasonalShop'),
|
||||
notes: res.t('seasonalShopClosedText'),
|
||||
imageName: 'seasonalshop_closed',
|
||||
opened: false,
|
||||
categories: shops.getSeasonalShopCategories(user, req.language),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user