mirror of https://github.com/msgbyte/tailchat
refactor: 添加好友
parent
6339efcba5
commit
47a72e3568
@ -0,0 +1,21 @@
|
|||||||
|
import { request } from '../api/request';
|
||||||
|
|
||||||
|
export interface FriendRequest {
|
||||||
|
from: string;
|
||||||
|
to: string;
|
||||||
|
message: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送好友请求
|
||||||
|
* @param targetId 目标用户id
|
||||||
|
*/
|
||||||
|
export async function addFriendRequest(
|
||||||
|
targetId: string
|
||||||
|
): Promise<FriendRequest> {
|
||||||
|
const { data } = await request.post('/api/friend/request/add', {
|
||||||
|
to: targetId,
|
||||||
|
});
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
Loading…
Reference in New Issue