-
-
Notifications
You must be signed in to change notification settings - Fork 666
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
Link cats with users #145
Comments
The session of the login is already mantained with the token in localstorage. Each user that login have its own token. |
Yes sir, But the data of one user is visible to other. How to show the data which is related to that particular user alone |
What do you mean? Tell me what you need to do in details. |
If X login and Enter details and then Y login, Y able to see X's details and X able to see Y's details. |
Are you talking about the cat data? Add user id to each cat and amend the
queries to filter data unique to each user?
…On 27 Dec 2017 12:17, "felixchristo" ***@***.***> wrote:
If X login and Enter details and then Y login, Y able to see X's details
and Y able to see X's details.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#145 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACm_CVH7uT-I-TK3Xj0QyDJ6OX7wcp4qks5tEjVpgaJpZM4RMk4G>
.
|
I think I need to edit base.js for that? |
If you could do that and update it, It will be very useful to all and the project will look meaningful |
I think this would be a good challenge to learn for you as this project is
a starter to build on.Base.js would be a good start.
When personalising the cat data that is held in the database, you might
want to consider whether you actually need a database? Local storage would
be an option.
…On Wed, Dec 27, 2017 at 1:09 PM, felixchristo ***@***.***> wrote:
If you could do that and update it, It will be very useful to all and the
project will look meaningful
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#145 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACm_CQI7Is_WB0yW6BYo1gNfm08ZD-R3ks5tEkGXgaJpZM4RMk4G>
.
|
The user data is private, the cat page and data is visible to all users, including the guests. I though about the cats as the "products" that can be seen by everyone. Currently there is no association between users and cats, since this is just a starter project and is meant to be simple. |
I am just getting this If I do cats: [{ type: Schema.Types.ObjectId, ref: 'Cat' }] in user.js |
It's not that simple, I just gave you an hint. Every time you do the add new cat you should update the cats array of the user that added that cat. |
Still I couldn't do this :( |
you should add createdBy in cat model , save userid on it then use ngif to filter cats list it's already worked for me : 3- in cat html file use this condition : |
logically sounds good buddy.. Let me try and get back to you |
yeaahhh it's working but the thing has to be done from server side buddy not from client side, which is not safe.. |
I'd recommend posting somewhere like stackoverflow.com for questions such
as this. There are plenty of helpful people on those question sites and
maybe already an answer that can help you.
…On 28 Feb 2018 03:01, "felixchristo" ***@***.***> wrote:
yeaahhh it's working but the thing has to be done from server side buddy
not from client side, which is not safe..
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#145 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACm_CV3DyLGQhUIFyZ9fUQSIrzuHls0Bks5tZMF6gaJpZM4RMk4G>
.
|
I think you can use the save(user) function ! I wanted to do same thing as you and I did it like that : 1)Add array property cats to user.model ( as davideviolante said above you can also use populate method, which may be more appropriate) you can check my repo I did it with film.detail.component.ts (instead of your cats I used films) |
Can you provide me with the project after you modifided it? |
How to maintain session with this so that each user can maintain their own data
The text was updated successfully, but these errors were encountered: