ваше сообщение коммита
This commit is contained in:
@@ -7,5 +7,13 @@ export default {
|
||||
return res.data.contacts;
|
||||
}
|
||||
return [];
|
||||
},
|
||||
async updateContact(id, data) {
|
||||
const res = await api.patch(`/api/users/${id}`, data);
|
||||
return res.data;
|
||||
},
|
||||
async deleteContact(id) {
|
||||
const res = await api.delete(`/api/users/${id}`);
|
||||
return res.data;
|
||||
}
|
||||
};
|
||||
9
frontend/src/services/messagesService.js
Normal file
9
frontend/src/services/messagesService.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import axios from 'axios';
|
||||
|
||||
export default {
|
||||
async getMessagesByUserId(userId) {
|
||||
if (!userId) return [];
|
||||
const { data } = await axios.get(`/api/messages?userId=${userId}`);
|
||||
return data;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user