final User user = User.fromMap(context.req.body );
TypeScript
type 'List<dynamic>' is not a subtype of type 'Map<String, dynamic>'
#0 new User.fromMap (package:dart_appwrite/src/models/user.dart:93)
#1 main (package:starter_template/main.dart:14)
#2 action.<anonymous closure> (file:///usr/local/server/src/server.dart:114)
#3 _rootRun (dart:async/zone.dart:1399)
TypeScript
{"$id":"65da8663ee6b6e2802ec", "25T00:14:28.175 00:00","email":"anika-von@pollich.info","phone":"","emailVerification":false,"phoneVerification":false,"prefs":[],"accessedAt":""}
TL;DR
Developers are encountering an issue where `context.req.body` returns a list instead of a map. The error indicates a mismatch in types. To resolve this, update the JSON input to have `"prefs":{}` instead of `"prefs":[]`.i am on all latest packages and self hosted latest server
Recommended threads
- Tips for Debugging Appwrite Functions Lo...
Hi everyone! 👋 I have an Appwrite Function running locally with Docker, but I’m struggling to debug it because execution doesn’t reach the breakpoints I set. ...
- AttributeError: 'Context' object has no ...
I'm getting an error executing my function. I'm not able to replicate this locally since I have to use a mock context. Is there a way to debug this kind of erro...
- SyntaxError: The requested module 'node-...
I am trying to use appwrite functions and in the function i am creating rows but i got this error when i executed the funtion. As i checked docs there TablesDB...