Disable send button on message when title and receivers are not set #5465
* Messages: use new component to show user profile when query has user to parameter * Messages: use async/await for consistency with other code * Change hardcoded url from component to userService so all strings related to endpoints are in the same place * Messages: allow send message only when title and to is defined * Messages: migrate a function from deprecated service to a new one * Add documentation on how to migrate message service --------- Co-authored-by: Angel Fernando Quiroz Campos <angelfqc.18@gmail.com>pull/5515/head
parent
544f847219
commit
137bc1ce0d
@ -1,3 +1,22 @@ |
||||
import makeService from './api'; |
||||
import makeService from "./api" |
||||
import baseService from "./baseService" |
||||
|
||||
export default makeService('messages'); |
||||
// MIGRATION IN PROGRESS. makeService is deprecated
|
||||
// if you use some method in this service you should try to refactor it with new baseService defining async functions
|
||||
// like create below. A fully migrated service looks like: assets/vue/services/userService.js.
|
||||
// BE AWARE that makeService use vuex, so we need to ensure behaviour to be the same as the older service
|
||||
// When makeService is fully migrated, export by default the const messageService and change imports in all components
|
||||
// that use this service
|
||||
export default makeService("messages") |
||||
|
||||
/** |
||||
* @param {Object} message |
||||
* @returns {Promise<Object>} |
||||
*/ |
||||
async function create(message) { |
||||
return await baseService.post("/api/messages", message) |
||||
} |
||||
|
||||
export const messageService = { |
||||
create, |
||||
} |
||||
|
Loading…
Reference in new issue