-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rename element key to property + make api safe to consume both variants * lint fix * lint fix --------- Co-authored-by: volar <[email protected]>
- Loading branch information
Showing
12 changed files
with
94 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// todo will be removed once rename key => property will be implemented | ||
|
||
import type { | ||
DamConfigAssetCustomFormElement, | ||
DamConfigAssetCustomFormElementTemp | ||
} from '@/types/coreDam/DamConfigAssetCustomForm' | ||
import { isDefined } from '@anzusystems/common-admin' | ||
|
||
export function mapElementsWithKeyToProperty | ||
(items: Array<DamConfigAssetCustomFormElementTemp> | ||
): Array<DamConfigAssetCustomFormElement> { | ||
return items.map(item => { | ||
return { | ||
id: item.id, | ||
property: isDefined(item.property) ? item.property as string : item.key as string, | ||
name: item.name, | ||
position: item.position, | ||
attributes: item.attributes, | ||
createdAt: item.createdAt, | ||
modifiedAt: item.modifiedAt, | ||
createdBy: item.createdBy, | ||
modifiedBy: item.modifiedBy, | ||
_system: item._system, | ||
_resourceName: item._resourceName, | ||
} | ||
}) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters