@open-tender/utils 0.1.54 → 0.1.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CreditCards, FormFields, GiftCardPurchase, RequestError, RequestStatus } from '@open-tender/types';
3
- export declare const useGiftCardForm: (giftCardId: number, creditCards: CreditCards, loading: RequestStatus, error: RequestError, update: (id: number, data: GiftCardPurchase, callback: () => void) => void, add: (data: GiftCardPurchase, callback: () => void) => void, callback: () => void) => {
3
+ export declare const useGiftCardForm: (creditCards: CreditCards, loading: RequestStatus, error: RequestError, update: (id: number, data: GiftCardPurchase, callback?: () => void) => void, add: (data: GiftCardPurchase, callback?: () => void) => void, callback?: () => void, giftCardId?: number) => {
4
4
  submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
5
5
  inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
6
6
  fields: FormFields;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useGiftCardForm = void 0;
4
4
  const react_1 = require("react");
5
5
  const utils_1 = require("../utils");
6
- const useGiftCardForm = (giftCardId, creditCards, loading, error, update, add, callback) => {
6
+ const useGiftCardForm = (creditCards, loading, error, update, add, callback, giftCardId) => {
7
7
  const submitRef = (0, react_1.useRef)(null);
8
8
  const inputRef = (0, react_1.useRef)(null);
9
9
  const customerCardId = creditCards[0].customer_card_id;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CreditCards, FormFields, GiftCardPurchase, RequestError, RequestStatus } from '@open-tender/types';
3
- export declare const useGiftCardForm: (giftCardId: number, creditCards: CreditCards, loading: RequestStatus, error: RequestError, update: (id: number, data: GiftCardPurchase, callback: () => void) => void, add: (data: GiftCardPurchase, callback: () => void) => void, callback: () => void) => {
3
+ export declare const useGiftCardForm: (creditCards: CreditCards, loading: RequestStatus, error: RequestError, update: (id: number, data: GiftCardPurchase, callback?: () => void) => void, add: (data: GiftCardPurchase, callback?: () => void) => void, callback?: () => void, giftCardId?: number) => {
4
4
  submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
5
5
  inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
6
6
  fields: FormFields;
@@ -1,6 +1,6 @@
1
1
  import { useState, useEffect, useRef } from 'react';
2
2
  import { makeFormErrors } from '../utils';
3
- export const useGiftCardForm = (giftCardId, creditCards, loading, error, update, add, callback) => {
3
+ export const useGiftCardForm = (creditCards, loading, error, update, add, callback, giftCardId) => {
4
4
  const submitRef = useRef(null);
5
5
  const inputRef = useRef(null);
6
6
  const customerCardId = creditCards[0].customer_card_id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/utils",
3
- "version": "0.1.54",
3
+ "version": "0.1.55",
4
4
  "description": "A library of utils for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",