fixing things regarding bson error with node and such...now working?

This commit is contained in:
talksik
2022-04-03 09:04:25 -04:00
parent 7205fac3f5
commit 19b90b2196
11 changed files with 248 additions and 41 deletions
@@ -31,3 +31,6 @@ export function useUserSearch(searchQuery: string) {
}
// =========== MUTATIONS
export function useGetDmByUserId() {
return useMutation(ApiCalls.getDmByUserId);
}
@@ -1,5 +1,6 @@
import axios, { AxiosRequestConfig, AxiosResponse, Method } from "axios";
import { Conversation } from "../../../core/models/conversation.model";
import LoginResponse from "../../../core/responses/login.response";
import { User } from "@nirvana/core/models";
import UserDetailsResponse from "../../../core/responses/userDetails.response";
@@ -69,9 +70,18 @@ async function userSearch(searchQuery: string): Promise<UserSearchResponse> {
);
}
async function getDmByUserId(otherUserId: string): Promise<Conversation> {
return await NirvanaApi.fetch(
`/conversations/dm/${otherUserId}`,
"GET",
true
);
}
export const ApiCalls = {
login,
authCheck,
getUserDetails,
userSearch,
getDmByUserId,
};