import { CreateUserResponse } from '../utils/interface/userInterface'; import apiEndpoints from './apiEndpoints'; export const createUser = async ( fullName: string, username: string, email: string, password: string ): Promise => { const response = await fetch(apiEndpoints.account.createUser, { method: 'POST', body: JSON.stringify({ fullName, username, email, password }), headers: { 'Content-Type': 'application/json', }, }); const data: CreateUserResponse = await response.json(); if (!response.ok) { throw new Error(data.message || 'Something went wrong!'); } return data; };