I want to create an ecommerce solution. And I would like to have some flows like when creating order and vice versa.
Well if it doesn't support extensions or plugins, at least it would be great to show some toasts to the admin in the appwrite so they know that they can't do some certaion operations.
I can hear some of you folks saying I should use functions but how can I return an error from it? And even if I can return error, does it show on appwrite dashboard? like when adding or updating a document?
You cannot add/implement middlewares, plugins or extensions on the console itself. If I understand you correctly, you need to show certain UI elements on some kind of events, for this you would have to build your own UI that implements your logic based on the returned values from the SDK responses.
Functions are suggested to execute some logic based on events. They can return values as well, based on which you could react on your implementations.
Also what exactly do you mean by this -
it would be great to show some toasts to the admin in the appwrite so they know that they can't do some certain operations.
An example or direction would be good to understand.
Let me give you a scenario. Let say I want to process an order, To do that I have to check inventory of the product and stock values should be higher than the ordered product quantity. if not, i can't process this order. i have to do this validation in backend.
Assuming this happens on "your" UI dashboard -
- You can either use
Queries
against DB calls for this to save Functions overhead - Use Functions that use these similar queries
Based on the result from the task, take appropriate actions.
But I can't do any affection on appwrite UI right?
Aah no. Console doesn't support extensions, custom UI, plugins, etc. Its uses the SDK for Console backed by rest apis.
So its best to create a separate dashboard for your project, if possible for the best UX.
to be precise i want to block admins to do mistakes on appwrite dashboard
yep i'll certainly do. i think i get it. i have to do this logic on the UI i'll implement
You could separate the admins into Teams, diff teams with diff roles and permissions. Make sure to checkout the Server as well as the Client SDKs. Pretty powerful to manage the underlying DBs.
thanks a lot. well it would be great to decouple business logic to the appwrite but sometimes nothing to do i guess 😄
Recommended threads
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...
- Function in Node.JS to monitor events ar...
Hello everyone. I'm creating my first Node.JS function, but I don't have much experience with node and javascript. I'm trying to create a function, that monito...
- Edit ID of an existing collection
Hi there. Is it possible to edit an ID of an existing collection? Right now it looks impossible from AppWrite cloud at least.