Shiba
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":[]`. Shiba
i am on all latest packages and self hosted latest server
Recommended threads
- HTTP POST to function returning "No Appw...
Hi everyone, I’m running into an issue with my self-hosted Appwrite instance. I’ve set up my environment variables (APPWRITE_FUNCTION_PROJECT_ID, APPWRITE_FUNC...
- Can't add dart 3.5 runtime
Modified the `.env` to enable dart 3.5 runtime on my self-hosted instance but still can't find the runtime when creating a new function. I manually pulled the i...
- How to verify an user using AppWrite Fun...
I have seen similar questions but none whose solutions serve me. I have a function to verify a user with their secret and their id: https://blahblah.appwrite.gl...