pl-fe: wip valibot migration

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-10-16 17:30:05 +02:00
parent a521c9044d
commit 905e1626a4
29 changed files with 75 additions and 63 deletions

View File

@@ -1,4 +1,5 @@
import { statusSchema } from 'pl-api';
import * as v from 'valibot';
import { Entities } from 'pl-fe/entity-store/entities';
import { normalizeStatus } from 'pl-fe/normalizers';
@@ -22,7 +23,7 @@ const buildStatus = (state: RootState, draftStatus: DraftStatus) => {
const me = state.me as string;
const account = state.entities[Entities.ACCOUNTS]?.store[me];
const status = statusSchema.parse({
const status = v.parse(statusSchema, {
id: 'draft',
account,
content: draftStatus.text.replace(new RegExp('\n', 'g'), '<br>'), /* eslint-disable-line no-control-regex */