Skip to content

Commit

Permalink
wip: Provide a messages service #908
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Jul 27, 2024
1 parent 0720d92 commit 6f734fe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/client/composables/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from './activity.js'
export * from './collection.js'
export * from './layout.js'
export * from './messages.js'
export * from './pwa.js'
export * from './session.js'
export * from './schema.js'
Expand Down
15 changes: 15 additions & 0 deletions core/client/composables/messages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { api } from '../api.js'

export function useMessages (contextId) {
const messagesService = api.getService('messages', contextId)

// Functions
async function createMessage (message) {
return messagesService.create(message)
}

// Expose
return {
createMessage
}
}

0 comments on commit 6f734fe

Please sign in to comment.