Skip to content

Commit

Permalink
Update JS deps
Browse files Browse the repository at this point in the history
  • Loading branch information
threecgreen committed Apr 3, 2022
1 parent 878d409 commit 4011007
Show file tree
Hide file tree
Showing 3 changed files with 5,705 additions and 4,455 deletions.
6 changes: 3 additions & 3 deletions web/front_end/new_wine/WineInputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ const getOrCreateVitiAreaForRegion = async (data: IWineData, regionId: number) =
return null;
};

const getProducerAndVitiArea = async (data: IWineData) => {
const getProducerAndVitiArea = async (data: IWineData): Promise<[IProducer, IVitiArea | null]> => {
const region = await getRegion({name: data.region});
return Promise.all<IProducer, IVitiArea | null>([
return Promise.all([
getOrCreateProducer({name: data.producer}, {name: data.producer, regionId: region.id}),
getOrCreateVitiAreaForRegion(data, region.id),
]);
};

export const wineDataToForm = async (data: IWineData, inventory: number): Promise<IWineForm> => {
const [color, wineType, [producer, vitiArea]] =
await Promise.all<IColor, IWineType, [IProducer, IVitiArea | null]>([
await Promise.all([
getColor({name: data.color}),
getOrCreateWineType({name: data.wineType}, {name: data.wineType}),
getProducerAndVitiArea(data),
Expand Down
Loading

0 comments on commit 4011007

Please sign in to comment.