bigbuffet-rw/packages/pl-hooks/lib/normalizers/account.ts
marcin mikołajczak d6aa4bf388 pl-hooks: Updates, add useStatusTranslation query
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-10-24 23:46:22 +02:00

10 lines
304 B
TypeScript

import type { Account as BaseAccount } from 'pl-api';
const normalizeAccount = ({ moved, relationship, ...account }: BaseAccount) => ({
...account,
moved_id: moved?.id || null,
});
type Account = ReturnType<typeof normalizeAccount>;
export { normalizeAccount, type Account as NormalizedAccount };