Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: #5982

Closed
2 tasks done
PavanSN opened this issue Aug 13, 2023 · 1 comment
Closed
2 tasks done

🐛 Bug Report: #5982

PavanSN opened this issue Aug 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@PavanSN
Copy link

PavanSN commented Aug 13, 2023

👟 Reproduction steps

When i tried calling create transaction function which is like from flutter

createTransaction({
    required UsersModel userData,
  }) async {
    try {
      var now = DateTime.now();
      var doc = await Databases(client).createDocument(
        databaseId: databaseId,
        collectionId: txnColId,
        documentId: ID.unique(),
        data: TransactionsModel(
          users: userData,
          isPaid: false,
          transactionDate:
              DateTime(now.year, now.month, now.day, 00, 00).toString(),
          amountPaid: 0,
          paymentType: ""
        ).toJson(),
      );
      print(doc.data);
    } on AppwriteException catch (e) {
      Fluttertoast.showToast(msg: e.message.toString());
      rethrow;
    } finally {
      Get.back();
    }
  }

👍 Expected behavior

It should actually create a document in transaction collection

👎 Actual Behavior

but it actually gave me an error saying

Error: AppwriteException: document_already_exists, Document with the requested ID already exists. (409)

no matter what i did, even passing custom document ID which didnt exist also failed.

🎲 Appwrite version

Version 1.3.x

💻 Operating system

MacOS

🧱 Your Environment

my pubspec.yaml file

name: maa_jewellery
description: A new Flutter project.
publish_to: 'none'

version: 1.0.0+1

environment:
  sdk: '>=3.0.6 <4.0.0'

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.2
  get: ^4.6.5
  getwidget: ^3.1.1
  calendar_date_picker2: ^0.5.2
  google_fonts: ^5.1.0
  sizer: ^2.0.15
  auto_size_text: ^3.0.0
  lottie: ^2.5.0
  flutter_typeahead: ^4.6.2
  qr_flutter: ^4.1.0
  appwrite: ^9.0.1
  fluttertoast: ^8.2.2
  get_storage: ^2.1.1
  responsive_framework: ^1.1.0
  quickalert: ^1.0.1

dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_lints: ^2.0.0

flutter:

  uses-material-design: true
  assets:
    - assets/

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@PavanSN PavanSN added the bug Something isn't working label Aug 13, 2023
@PavanSN
Copy link
Author

PavanSN commented Aug 13, 2023

I deleted the collection and remade it, Now its working, I dont know how but it works atleast for now..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant