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
- Feedback and Deployment Challenges with ...
Hello world!, I've been developing a project using FastAPI in Python, and I was considering deploying it through Appwrite Functions. However, I encountered a f...
- Bulk feature status
Hi there, I am using version 1.7.4 self hosted and wanted to use the bulk operations in a dart function. I saw that in the dart_appwrite sdk version 16.1.0 it ...
- CORS preflight returns 500 on Dart funct...
Hey everyone 👋 I’m running a Dart cloud function, Every time I respond to a preflight (OPTIONS) request, I get a 500 internal error, and the logs show: ```NoSu...