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:
2026-01-04 00:01:26 +01:00
parent e553103470
commit c33508a227
17 changed files with 456 additions and 295 deletions

View File

@@ -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 = {