Skip to content

Commit

Permalink
Set imager to ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Loule95450 committed Feb 28, 2024
1 parent d620fa3 commit cba9095
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import {
Camera,
useCameraDevice,
useCameraFormat,
useCodeScanner,
useCameraPermission,
useCodeScanner,
} from 'react-native-vision-camera';
import {getProduct} from '../../service/apiCall';
import React from 'react';

export const Imager = () => {
const {hasPermission, requestPermission} = useCameraPermission();
Expand All @@ -18,7 +19,7 @@ export const Imager = () => {
codeTypes: ['qr', 'ean-13'],
onCodeScanned: codes => {
codes.forEach(code => {
if (code.type == 'ean-13')
if (code.type === 'ean-13')
getProduct(code.value).then(
result =>
console.log(
Expand Down
2 changes: 0 additions & 2 deletions src/service/apiCall.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import {logger} from 'react-native-logs';

const apiUrl = 'https://world.openfoodfacts.org/api/v2/product/';

export async function getProduct(barcode: string) {
Expand Down

0 comments on commit cba9095

Please sign in to comment.