mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
refactor: use languageSchema in createStatusSchema
This commit is contained in:
parent
92aaca0d91
commit
12aaf8c678
1 changed files with 2 additions and 2 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
import { HTTPException } from '@hono/hono/http-exception';
|
import { HTTPException } from '@hono/hono/http-exception';
|
||||||
import { NostrEvent, NSchema as n } from '@nostrify/nostrify';
|
import { NostrEvent, NSchema as n } from '@nostrify/nostrify';
|
||||||
import ISO6391 from 'iso-639-1';
|
|
||||||
import 'linkify-plugin-hashtag';
|
import 'linkify-plugin-hashtag';
|
||||||
import linkify from 'linkifyjs';
|
import linkify from 'linkifyjs';
|
||||||
import { nip19 } from 'nostr-tools';
|
import { nip19 } from 'nostr-tools';
|
||||||
|
|
@ -14,6 +13,7 @@ import { getAncestors, getAuthor, getDescendants, getEvent } from '@/queries.ts'
|
||||||
import { addTag, deleteTag } from '@/utils/tags.ts';
|
import { addTag, deleteTag } from '@/utils/tags.ts';
|
||||||
import { asyncReplaceAll } from '@/utils/text.ts';
|
import { asyncReplaceAll } from '@/utils/text.ts';
|
||||||
import { lookupPubkey } from '@/utils/lookup.ts';
|
import { lookupPubkey } from '@/utils/lookup.ts';
|
||||||
|
import { languageSchema } from '@/schema.ts';
|
||||||
import { Storages } from '@/storages.ts';
|
import { Storages } from '@/storages.ts';
|
||||||
import { hydrateEvents } from '@/storages/hydrate.ts';
|
import { hydrateEvents } from '@/storages/hydrate.ts';
|
||||||
import { createEvent, paginated, paginatedList, parseBody, updateListEvent } from '@/utils/api.ts';
|
import { createEvent, paginated, paginatedList, parseBody, updateListEvent } from '@/utils/api.ts';
|
||||||
|
|
@ -26,7 +26,7 @@ import { renderReblog, renderStatus } from '@/views/mastodon/statuses.ts';
|
||||||
|
|
||||||
const createStatusSchema = z.object({
|
const createStatusSchema = z.object({
|
||||||
in_reply_to_id: n.id().nullish(),
|
in_reply_to_id: n.id().nullish(),
|
||||||
language: z.string().refine(ISO6391.validate).nullish(),
|
language: languageSchema.nullish(),
|
||||||
media_ids: z.string().array().nullish(),
|
media_ids: z.string().array().nullish(),
|
||||||
poll: z.object({
|
poll: z.object({
|
||||||
options: z.string().array(),
|
options: z.string().array(),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue