Created
January 24, 2022 19:37
-
-
Save SahanAmarsha/d3c88530ef636621ebef47a53c86c2a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DataStore } from "@aws-amplify/datastore"; | |
import { Car } from "./models"; | |
... | |
const saveCar = async () => { | |
try { | |
await DataStore.save( | |
new Car({ | |
name: name, | |
price: parseFloat(price), | |
description: description, | |
imageUrl: imageUrl, | |
}) | |
); | |
} catch (err) { | |
console.log(err); | |
} | |
}; | |
... | |
const addCarOverrides = { | |
.... | |
"Flex.Flex[0].Flex[2].Button[0]": { | |
onClick: saveCar, | |
}, | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment