Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function query() {
const posts = await DataStore.query(Post);
console.log('posts: ', posts)
const original = await DataStore.query(Post, "4d5a08f3-d0ac-42bd-a19e-170991a4d79b");
// await DataStore.save(
// Post.copyOf(original, updated => {
// updated.title = `title ${Date.now()}`;
// updated.status = PostStatus.ACTIVE
// })
// );
}
async function create() {
async function query() {
const posts = await DataStore.query(Post);
console.log('posts: ', posts)
const original = await DataStore.query(Post, "4d5a08f3-d0ac-42bd-a19e-170991a4d79b");
// await DataStore.save(
// Post.copyOf(original, updated => {
// updated.title = `title ${Date.now()}`;
// updated.status = PostStatus.ACTIVE
// })
// );
}
async function create() {
async function onQuery(setPosts) {
const posts = await DataStore.query(Post, c => c.rating("gt", 4));
setPosts(posts)
}