Fully functional opening transactions

This commit is contained in:
2025-02-16 03:17:29 +01:00
parent b5039f6468
commit 148b1d00c4
9 changed files with 114 additions and 50 deletions

View File

@@ -13,9 +13,9 @@ export const AccountEdit: React.FC = () => {
id={id}
/>
<CrudForm
schemaName={"AccountUpdate"}
resource={`accounts/${id}/opening`}
id={id}
schemaName={"OpeningTransactionUpdate"}
resource={`accounts/${id}/opening_state`}
id=""
/>
</div>
);

View File

@@ -14,8 +14,7 @@ const fetcher = async (url: string, options?: RequestInit) => {
export const dataProvider: DataProvider = {
getOne: async ({ resource, id, meta }) => {
const response = await fetcher(`${API_URL}/${resource}/${id}`);
const response = id !== "" ? await fetcher(`${API_URL}/${resource}/${id}`) : await fetcher(`${API_URL}/${resource}`);
if (response.status < 200 || response.status > 299) throw response;
const data = await response.json();