Add Preference at the time of Account Creation #3314
Replies: 3 comments 2 replies
|
It's always hard to decide when to couple request and when to not. So far we mainly tried to have consistency across APIs, sometimes unsuccessfully. If we do consider something like this, I think it should be a philosophical decision about what our approach is and why and how it affects all other REST APIs. I don't think 1 API call vs 2 is a good enough argument for deciding on this change. |
|
I personally agree with Eldad on this. Looking at other services such as Database or Storage, I can see similar behavior:
I see these examples as micro-optim, just like I would see request&response modification or using short IDs for collections to make requests smaller. On the other hand, I see these options in Appwrite:
I believe both of these came from the same problem - having to fire multiple requests. But in these examples, it is a bit more extreme, as you would need to keep firing many requests until one says the status of build/execution is finished. Also, considering the amount of code necessary for implementation, these two need like 10-liner to implement a recursive method. For same reason I would consider these as possible feature requests:
With 2 requests there won't be much of a change, but you might want to delete hundreds of documents at the same time. There, the difference would be huge. After reading these, what are your thoughts? Do you still consider making one request instead of two crucial? If yes, can you explain in detail your reasons why that is a problem (like coding time, app performance, server load...) please? |
|
I think it's best to explain my business needs and maybe you guys can guide me in the right direction. I need to register two types of users, One is the patient type and the other type is the doctor. The Platform owner can register both types of users. I am storing user type in the preference because I need this info at the time on login so that I can do things based on it. Currently, this is how I am doing. When the platform owner registers using create account API on the client-side, I get the user ID of the new user. Then I invoke a serverless function from the frontend using “sdk.functions.createExecution” by passing type and new userID as data from the client-side. On the server-side, I update the user preference of the user based on the data I received. As The new user ID is also part of the data, I received, I separated the user ID from the data object at the server-side. Am I doing right? I can not use “create user event” as I need to pass additional data while creating the account and create account function on the client-side only takes 3 parameters. It will be nice if I can pass additional data wth create account function one client-side, I can process this create account event. Can I make it better or am I missing anything? Please guide me. Thanks |
Uh oh!
There was an error while loading. Please reload this page.
I would like to suggest the addition of preference in the Account POST API while creating user Accounts. It avoids invoking two APIs from the client Side. if the preference is known beforehand, it can be added at the time of User Account Creation. However, the Preference payload should be an optional object.
All reactions