Closed gabelula closed 8 years ago
@gabelula, Send an example of how this might look like. Is there an ID
for this user?
As per our talks, here is how we might accomplish a generic "add user if doesn't exist" paradigm in the system.
type ImportSource struct {
ID string `json:"id,omitempty" bson:"id,omitempty"`
UserID string `json:"user_id,omitempty" bson:"user_id,omitempty"`
TargetID string `json:"target_id,omitempty" bson:"target_id,omitempty"`
AssetID string `json:"asset_id,omitempty" bson:"asset_id,omitempty"`
ParentID string `json:"parent_id,omitempty" bson:"parent_id,omitempty"`
User User `json:"user,omitempty" bson:"user,omitempty"`
}
Introduce a new field User
in ImportSource
. This will take care of all use-cases of adding users to the system through various import APIs.
This is a very good option because we can use this in everything where we have an ImportSource, for example the comments.
Resolved - See #102
Expected behavior
We want users to be created when they comment or like or flag a comment.
Actual behavior
We are only creating the users that comment.