Back

[CLOSED] trying to update pref, its deleting all previous data.

  • 0
  • Flutter
conqueror
22 May, 2023, 21:57

If try to update pref then its deleting all previous data and updating only one field which i am updating . it is deleting all the previous data and updating only the "currency" field with the value of newcurrency.

TypeScript
              prefs: {
                "currency":newcurrency,
              },
            );```
TL;DR
User is experiencing a problem where updating a preference is deleting all previous data. They are using the `updatePrefs` function from the appwrite.io documentation. The function is only storing the new data instead of updating it. Another user suggests concatenating the previous data. There is no solution provided in the thread.
RangerDev
22 May, 2023, 21:58

is this an array?

Binyamin
22 May, 2023, 21:58

You'll need to concat the previous one

RangerDev
22 May, 2023, 21:59

its funny cuz I was having the same issue yesterday lol

conqueror
22 May, 2023, 21:59

but why.

Binyamin
22 May, 2023, 21:59

Because the function only store the data

Binyamin
22 May, 2023, 21:59

It doesn't update it

conqueror
22 May, 2023, 21:59

hmm

conqueror
22 May, 2023, 22:01

doc link for pref

Binyamin
22 May, 2023, 22:02

This?

conqueror
22 May, 2023, 22:02

ok got i t

conqueror
22 May, 2023, 22:02

is there is option for creating pref ?

Binyamin
22 May, 2023, 22:03

No

Binyamin
22 May, 2023, 22:03

Just get and update

conqueror
22 May, 2023, 22:03

ok

joeyouss
25 May, 2023, 18:42

[CLOSED] trying to update pref, its deleting all previous data.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more