Closed elkee2003 closed 8 months ago
Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the feature you'd like to request
When I try to save or have access to the database user, I am unable to access it. For example, if I try to save a user, sometimes it doesn't save. If it eventually saves, if I try to edit it from my app, and save, it doesn't reflect in amplify studio.
Describe your use case and how the feature would improve your experience.
I am setting database user here: `import { createContext, useState,useEffect, useContext } from "react"; import { confirmResetPassword, getCurrentUser } from 'aws-amplify/auth'; import { DataStore, Predicates } from 'aws-amplify/datastore'; import { User } from "../models"; // import {Auth, Amplify, Predicates} from 'aws-amplify'; // import { getCurrentUser, AuthUser } from 'aws-amplify/auth'; // import { DataStore, AuthModeStrategyType } from 'aws-amplify/datastore';
const AuthContext = createContext({})
const AuthContextProvider = ({children})=>{
}
export default AuthContextProvider;
export const useAuthContext = ()=> useContext(AuthContext)`
I am trying to create or edit it here: `// import '@azure/core-asynciterator-polyfill' import { View, Text, TextInput, Button, Pressable, Alert } from 'react-native' import React, {useEffect, useState, } from 'react' import { GooglePlacesAutocomplete } from 'react-native-google-places-autocomplete'; import styles from './styles' import { useAuthContext } from '../../contexts/AuthContext' import { useNavigation } from '@react-navigation/native' import { signOut } from 'aws-amplify/auth'; import { DataStore } from 'aws-amplify/datastore'; import {User} from '../../models'
const ProfileScreen = () => {
const {sub, dbUser, setDbUser} = useAuthContext()
const handleSignOut = async()=> { try { await signOut(); } catch (error) { console.log('error signing out: ', error); } }
) }
export default ProfileScreen`
However, most of the times, it is unable to access the database user to make changes.
Describe alternatives you've considered
I have considered doing amplify update api, automerge update, amplify codegen models and then amplify push, hoping i will be able to automatically access the database in the future, but I can't access it.
Additional context
No response