implement chat messaging with event proposals
- Add functional chat with server communication and test responses - Add ProposedEventCard component for confirm/reject actions - Move Constants (Day, Month) from client to shared package - Add dateHelpers utility for weekday calculations - Extend Themes.tsx with button and text colors - Update CLAUDE.md with current implementation status - Add *.tsbuildinfo to .gitignore
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const API_BASE_URL =
|
||||
process.env.EXPO_PUBLIC_API_URL || "http://localhost:3000/api";
|
||||
process.env.EXPO_PUBLIC_API_URL || "http://localhost:3001/api";
|
||||
|
||||
type HttpMethod = "GET" | "POST" | "PUT" | "DELETE";
|
||||
|
||||
@@ -9,11 +9,24 @@ interface RequestOptions {
|
||||
}
|
||||
|
||||
async function request<T>(
|
||||
_method: HttpMethod,
|
||||
_endpoint: string,
|
||||
_options?: RequestOptions,
|
||||
method: HttpMethod,
|
||||
endpoint: string,
|
||||
options?: RequestOptions,
|
||||
): Promise<T> {
|
||||
throw new Error("Not implemented");
|
||||
const response = await fetch(`${API_BASE_URL}${endpoint}`, {
|
||||
method,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
body: options?.body ? JSON.stringify(options.body) : undefined,
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP ${response.status}`);
|
||||
}
|
||||
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export const ApiClient = {
|
||||
|
||||
Reference in New Issue
Block a user