Skip to content

Commit

Permalink
fix(common): updated docs
Browse files Browse the repository at this point in the history
added await to db query causing the value to be promise and causing server crash

Issue#2868
  • Loading branch information
Rana-Faraz committed Nov 27, 2024
1 parent d0e5a06 commit b285b34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/docs/guides/developer-guide/plugins/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export class WishlistService {
*/
async addItem(ctx: RequestContext, variantId: ID): Promise<WishlistItem[]> {
const customer = await this.getCustomerWithWishlistItems(ctx);
const variant = this.productVariantService.findOne(ctx, variantId);
const variant = await this.productVariantService.findOne(ctx, variantId);
if (!variant) {
throw new UserInputError(`No ProductVariant with the id ${variantId} could be found`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class WishlistService {
*/
async addItem(ctx: RequestContext, variantId: ID): Promise<WishlistItem[]> {
const customer = await this.getCustomerWithWishlistItems(ctx);
const variant = this.productVariantService.findOne(ctx, variantId);
const variant = await this.productVariantService.findOne(ctx, variantId);
if (!variant) {
throw new UserInputError(`No ProductVariant with the id ${variantId} could be found`);
}
Expand Down

0 comments on commit b285b34

Please sign in to comment.