Skip to content

Commit

Permalink
Handle async in methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Takeda committed Jul 26, 2023
1 parent dd75260 commit 4f5771e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions react/utils/metrics/useQuote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export type UseQuoteMetricsParams = {
sessionResponse: SessionResponse
}

const buildUseQuoteMetric = async (
const buildUseQuoteMetric = (
metricsParam: UseQuoteMetricsParams
): Promise<UseQuoteMetric> => {
): UseQuoteMetric => {
const { quoteState, orderFormId, account, sessionResponse } = metricsParam

const metric: UseQuoteMetric = {
Expand Down Expand Up @@ -56,9 +56,9 @@ export const sendUseQuoteMetric = async (
metricsParam: UseQuoteMetricsParams
) => {
try {
const metric = await buildUseQuoteMetric(metricsParam)
const metric = buildUseQuoteMetric(metricsParam)

sendMetric(metric)
await sendMetric(metric)
} catch (error) {
console.warn('Unable to log metrics', error)
}
Expand Down

0 comments on commit 4f5771e

Please sign in to comment.