Add comments for code structure clarity; enhance readability across multiple components

This commit is contained in:
bobbert committed 2026-04-05 18:07:45 +01:00
1 parent d67522a71d
commit 9b9f13eb6a
29 files changed
+1020 -846

No files matched your search

+2 -21
View File
@@ -1,22 +1,3 @@
import Constants from 'expo-constants';
const API_BASE_URL = 'http://localhost:3000';
const hostFromExpo = Constants.expoConfig?.hostUri?.split(':')[0] || null;
const apiBaseUrl = 'http://localhost:3000'; // Shirish, i need to deploy the database first so... wait until that... sorry buddy...
// if you want you can run your own db locally i can send you the files for it just ask :(((
const postJson = async (path, payload) => {
const response = await fetch(`${apiBaseUrl}${path}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
});
const result = await response.json();
if (!response.ok) {
throw new Error(result.message || 'Request failed');
}
return result;
};
export const postDb = async (action, payload = {}) => {
return postJson('/db', { action, payload });
};
export default API_BASE_URL;