Skip to content

Commit

Permalink
fix: Return empty array for empty threads
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Dec 20, 2019
1 parent 14736ea commit fdb1e54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/daf-data-store/src/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export const resolvers = {
vc: async (message: any, {}, { dataStore }: Context) => dataStore.credentialsForMessageId(message.id),
metaData: async (message: any, {}, { dataStore }: Context) => dataStore.messageMetaData(message.id),
thread: async (message: any, {}, { dataStore }: Context) => {
if (!message.threadId) {
return []
}
const messages = await dataStore.findMessages({ threadId: message.threadId })
return messages.filter((item: any) => item.id !== message.id)
},
Expand Down

0 comments on commit fdb1e54

Please sign in to comment.