Merge pull request #17575 from mozilla/fix-nextjsactions-validation

fix(payments): failed validation does not reject
This commit is contained in:
Reino Muhl 2024-09-11 12:06:30 -04:00 коммит произвёл GitHub
Родитель 8310065e88 37dd3db33b
Коммит ed7019cd86
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 10 добавлений и 10 удалений

Просмотреть файл

@ -34,7 +34,7 @@ export class NextJSActionsService {
) {} ) {}
async getCart(args: GetCartActionArgs) { async getCart(args: GetCartActionArgs) {
new Validator().validateOrReject(args); await new Validator().validateOrReject(args);
const cart = await this.cartService.getCart(args.cartId); const cart = await this.cartService.getCart(args.cartId);
@ -42,7 +42,7 @@ export class NextJSActionsService {
} }
async updateCart(args: UpdateCartActionArgs) { async updateCart(args: UpdateCartActionArgs) {
new Validator().validateOrReject(args); await new Validator().validateOrReject(args);
await this.cartService.updateCart( await this.cartService.updateCart(
args.cartId, args.cartId,
@ -52,7 +52,7 @@ export class NextJSActionsService {
} }
async restartCart(args: RestartCartActionArgs) { async restartCart(args: RestartCartActionArgs) {
new Validator().validateOrReject(args); await new Validator().validateOrReject(args);
const cart = await this.cartService.restartCart(args.cartId); const cart = await this.cartService.restartCart(args.cartId);
@ -60,7 +60,7 @@ export class NextJSActionsService {
} }
async setupCart(args: SetupCartActionArgs) { async setupCart(args: SetupCartActionArgs) {
new Validator().validateOrReject(args); await new Validator().validateOrReject(args);
const cart = await this.cartService.setupCart({ const cart = await this.cartService.setupCart({
...args, ...args,
@ -70,7 +70,7 @@ export class NextJSActionsService {
} }
async finalizeCartWithError(args: FinalizeCartWithErrorArgs) { async finalizeCartWithError(args: FinalizeCartWithErrorArgs) {
new Validator().validateOrReject(args); await new Validator().validateOrReject(args);
await this.cartService.finalizeCartWithError( await this.cartService.finalizeCartWithError(
args.cartId, args.cartId,
@ -79,7 +79,7 @@ export class NextJSActionsService {
} }
async getPayPalCheckoutToken(args: GetPayPalCheckoutTokenArgs) { async getPayPalCheckoutToken(args: GetPayPalCheckoutTokenArgs) {
new Validator().validateOrReject(args); await new Validator().validateOrReject(args);
const token = await this.checkoutTokenManager.get(args.currencyCode); const token = await this.checkoutTokenManager.get(args.currencyCode);
@ -87,7 +87,7 @@ export class NextJSActionsService {
} }
async checkoutCartWithPaypal(args: CheckoutCartWithPaypalActionArgs) { async checkoutCartWithPaypal(args: CheckoutCartWithPaypalActionArgs) {
new Validator().validateOrReject(args); await new Validator().validateOrReject(args);
await this.cartService.checkoutCartWithPaypal( await this.cartService.checkoutCartWithPaypal(
args.cartId, args.cartId,
@ -98,7 +98,7 @@ export class NextJSActionsService {
} }
async checkoutCartWithStripe(args: CheckoutCartWithStripeActionArgs) { async checkoutCartWithStripe(args: CheckoutCartWithStripeActionArgs) {
new Validator().validateOrReject(args); await new Validator().validateOrReject(args);
await this.cartService.checkoutCartWithStripe( await this.cartService.checkoutCartWithStripe(
args.cartId, args.cartId,
@ -109,7 +109,7 @@ export class NextJSActionsService {
} }
async fetchCMSData(args: FetchCMSDataArgs) { async fetchCMSData(args: FetchCMSDataArgs) {
new Validator().validateOrReject(args); await new Validator().validateOrReject(args);
const offering = await this.productConfigurationManager.fetchCMSData( const offering = await this.productConfigurationManager.fetchCMSData(
args.offeringId, args.offeringId,
@ -123,7 +123,7 @@ export class NextJSActionsService {
* @@todo: Emit event using Emittery. To be added as part of FXA-10087 * @@todo: Emit event using Emittery. To be added as part of FXA-10087
*/ */
async recordGleanEvent(args: RecordGleanEvent) { async recordGleanEvent(args: RecordGleanEvent) {
new Validator().validateOrReject(args); await new Validator().validateOrReject(args);
// Temporary ignore until Emittery logic is added // Temporary ignore until Emittery logic is added
//eslint-disable-next-line @typescript-eslint/no-unused-vars //eslint-disable-next-line @typescript-eslint/no-unused-vars