Back

Permissions Error updating documents

  • 0
  • Databases
  • React Native
KeyStone
11 Sep, 2024, 02:24

Currently running into this error when trying to update any documents:

AppwriteException: Invalid permissions param: Every permission must be of type string.

Here is an example of some code that is triggering it:

export const updateDayStats = async (userId, foodCalories, foodTotalFat) => { try { const day = await databases.updateDocument( databaseId, dayCollectionId, userId, {calories: foodCalories}, {totalFat: foodTotalFat}, ); return day } catch (error) { throw new Error(error) } }

And I have create, read, update, and delete permissions checked for users in the collection. I have another project that I haven't worked on in about a month or so, and in it I have update codes the same exact way as I am trying here and it worked fine. Did something with permissions change or am I doing something wrong?

TL;DR
Developers are encountering a permissions error while updating documents, specifically related to permission types. The error requires every permission to be of type string. The provided code snippet triggers this error. The issue may be due to changes in permissions or an error in the code. Check and ensure that all permissions are set as strings in the code.
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