diff --git a/src/app/api/supabase/story.ts b/src/app/api/supabase/story.ts index 3568f35..aa8198b 100644 --- a/src/app/api/supabase/story.ts +++ b/src/app/api/supabase/story.ts @@ -1,7 +1,10 @@ +import { User } from './user'; + export class Story { id: string; standup_id: number; - user_id: string + user_id: string; + user?: User; src: string; created_at: string | Date; diff --git a/src/app/api/supabase/user.service.ts b/src/app/api/supabase/user.service.ts index 1c6e287..7350b09 100644 --- a/src/app/api/supabase/user.service.ts +++ b/src/app/api/supabase/user.service.ts @@ -79,12 +79,12 @@ export class UserService { * Retrieve users from local store. * @param id */ - getOne(id: number) { + getOne(id: string) { if (this.userMap[id]) { return of(this.userMap[id]); } else { const subject: Subject = new Subject(); - this.supa.client.from('user').select('id, name, description') + this.supa.client.from('user').select() .filter('id', 'eq', id) .then(data => { this.updateStore([data.body[0]]); @@ -109,6 +109,7 @@ export class UserService { .match({ id: user.id }) .then(data => { subject.next(data.body[0]); + this.updateStore([data.body[0]]); subject.complete(); }) .catch(error => { @@ -147,6 +148,7 @@ export class UserService { this.supa.client.from('user').insert(user) .then(data => { subject.next(data.body[0]); + this.updateStore([data.body[0]]); subject.complete(); }) .catch(error => {