fix: Prevent edit page crash and correct date formatting
On the company edit page, added optional chaining to the `defaultValues` prop. This prevents a potential runtime error if the company data is undefined when the page loads. Additionally, this commit corrects the `unixToDate` utility function. The previous logic could incorrectly include 'false' in the format string when time was not required. It now uses a ternary operator to conditionally add the time format, ensuring correct output. Minor code formatting adjustments are also included.
This commit is contained in:
@@ -128,7 +128,7 @@ export const companyCategoriesService = {
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
updateCategories: async ({
|
||||
updateCategories: async ({
|
||||
id,
|
||||
credentials,
|
||||
}: {
|
||||
|
||||
Reference in New Issue
Block a user