Fully functional opening transactions
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user