mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-25 02:31:59 -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
|
* @private
|
||||||
* @param {import('bookshelf').Model<any>} model
|
* @param {import('bookshelf').Model<any>} model
|
||||||
* @param {BaseOptions} options
|
* @param {BaseOptions} options
|
||||||
* @returns {Promise<Offer>}
|
* @returns {Promise<import('@tryghost/members-offers').Offer>}
|
||||||
*/
|
*/
|
||||||
async mapToOffer(model, options) {
|
async mapToOffer(model, options) {
|
||||||
const json = model.toJSON();
|
const json = model.toJSON();
|
||||||
|
@ -123,7 +123,7 @@ class OfferBookshelfRepository {
|
||||||
/**
|
/**
|
||||||
* @param {string} id
|
* @param {string} id
|
||||||
* @param {BaseOptions} [options]
|
* @param {BaseOptions} [options]
|
||||||
* @returns {Promise<Offer>}
|
* @returns {Promise<import('@tryghost/members-offers').Offer>}
|
||||||
*/
|
*/
|
||||||
async getById(id, options) {
|
async getById(id, options) {
|
||||||
const model = await this.OfferModel.findOne({id}, {
|
const model = await this.OfferModel.findOne({id}, {
|
||||||
|
@ -141,7 +141,7 @@ class OfferBookshelfRepository {
|
||||||
/**
|
/**
|
||||||
* @param {string} id stripe_coupon_id
|
* @param {string} id stripe_coupon_id
|
||||||
* @param {BaseOptions} [options]
|
* @param {BaseOptions} [options]
|
||||||
* @returns {Promise<Offer>}
|
* @returns {Promise<import('@tryghost/members-offers').Offer>}
|
||||||
*/
|
*/
|
||||||
async getByStripeCouponId(id, options) {
|
async getByStripeCouponId(id, options) {
|
||||||
const model = await this.OfferModel.findOne({stripe_coupon_id: id}, {
|
const model = await this.OfferModel.findOne({stripe_coupon_id: id}, {
|
||||||
|
@ -158,7 +158,7 @@ class OfferBookshelfRepository {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ListOptions} options
|
* @param {ListOptions} options
|
||||||
* @returns {Promise<Offer[]>}
|
* @returns {Promise<import('@tryghost/members-offers').Offer[]>}
|
||||||
*/
|
*/
|
||||||
async getAll(options) {
|
async getAll(options) {
|
||||||
const models = await this.OfferModel.findAll({
|
const models = await this.OfferModel.findAll({
|
||||||
|
|
Loading…
Add table
Reference in a new issue