Skip to content

Commit

Permalink
refactor: optional properties in asset API
Browse files Browse the repository at this point in the history
  • Loading branch information
arealclimber committed Oct 1, 2024
1 parent 97894df commit 4fe148b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iSunFA",
"version": "0.8.2+24",
"version": "0.8.2+25",
"private": false,
"scripts": {
"dev": "next dev",
Expand Down
13 changes: 6 additions & 7 deletions src/pages/api/v2/company/[companyId]/asset/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,15 @@ export async function handlePostRequest(req: NextApiRequest) {
// TODO: (20241001 - Shirley) implement API
// eslint-disable-next-line @typescript-eslint/no-unused-vars
amount,
// depreciationStart,
// depreciationMethod,
// usefulLife,
depreciationStart,
depreciationMethod,
usefulLife,
note,
} = req.body as ICreateAssetInput;

// ToDo: (20240927 - Shirley) 驗證資產數據
// ToDo: (20240927 - Shirley) 在資料庫中創建資產數據
// ToDo: (20240927 - Shirley) 獲取並格式化創建後的資產數據

payload = {
...mockAssetDetails,
assetName,
Expand All @@ -81,9 +80,9 @@ export async function handlePostRequest(req: NextApiRequest) {
acquisitionDate,
purchasePrice,
currencyAlias,
// depreciationStart,
// depreciationMethod,
// usefulLife,
depreciationStart: depreciationStart || 0,
depreciationMethod: depreciationMethod || '',
usefulLife: usefulLife || 0,
note,
createdAt: getTimestampNow(),
updatedAt: getTimestampNow(),
Expand Down

0 comments on commit 4fe148b

Please sign in to comment.