Skip to content
Snippets Groups Projects
unfollow-user.ts 309 B
export const unfollowUser = async (
    user_id: string,
) => {
    try {
        const { data } = await fetch(`/api/users/follow?user_id=${user_id}`, {
            method: "DELETE"
        }).then((result) => result.json())

        return data
    } catch (error: any) {
        return error.message
    }
}