mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
Fixed Offer entity types in OfferBookshelfRepository
JSDoc has a problem with using values as types across repositories, rather than getting `Offer` as the type we end up with `typeof Offer` as the type - which is incorrect. Instead we use `import` syntax inside of JSDoc which resolves correctly
This commit is contained in:
parent
127c61d4c6
commit
84e6026408
1 changed files with 4 additions and 4 deletions
|
@ -91,7 +91,7 @@ class OfferBookshelfRepository {
|
|||
* @private
|
||||
* @param {import('bookshelf').Model<any>} model
|
||||
* @param {BaseOptions} options
|
||||
* @returns {Promise<Offer>}
|
||||
* @returns {Promise<import('@tryghost/members-offers').Offer>}
|
||||
*/
|
||||
async mapToOffer(model, options) {
|
||||
const json = model.toJSON();
|
||||
|
@ -123,7 +123,7 @@ class OfferBookshelfRepository {
|
|||
/**
|
||||
* @param {string} id
|
||||
* @param {BaseOptions} [options]
|
||||
* @returns {Promise<Offer>}
|
||||
* @returns {Promise<import('@tryghost/members-offers').Offer>}
|
||||
*/
|
||||
async getById(id, options) {
|
||||
const model = await this.OfferModel.findOne({id}, {
|
||||
|
@ -141,7 +141,7 @@ class OfferBookshelfRepository {
|
|||
/**
|
||||
* @param {string} id stripe_coupon_id
|
||||
* @param {BaseOptions} [options]
|
||||
* @returns {Promise<Offer>}
|
||||
* @returns {Promise<import('@tryghost/members-offers').Offer>}
|
||||
*/
|
||||
async getByStripeCouponId(id, options) {
|
||||
const model = await this.OfferModel.findOne({stripe_coupon_id: id}, {
|
||||
|
@ -158,7 +158,7 @@ class OfferBookshelfRepository {
|
|||
|
||||
/**
|
||||
* @param {ListOptions} options
|
||||
* @returns {Promise<Offer[]>}
|
||||
* @returns {Promise<import('@tryghost/members-offers').Offer[]>}
|
||||
*/
|
||||
async getAll(options) {
|
||||
const models = await this.OfferModel.findAll({
|
||||
|
|
Loading…
Add table
Reference in a new issue