instanceSchema: v1.uri -> v2.domain

This commit is contained in:
Alex Gleason 2024-03-25 11:17:12 -05:00
parent a4bea06b76
commit 4e7a3e018c
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 3 additions and 0 deletions

View File

@ -176,6 +176,7 @@ const instanceV1Schema = coerceObject({
stats: statsSchema,
thumbnail: z.string().catch(''),
title: z.string().catch(''),
uri: z.string().catch(''),
urls: coerceObject({
streaming_api: z.string().url().optional().catch(undefined),
}),
@ -200,6 +201,7 @@ const instanceSchema = z.preprocess((data: any) => {
registrations,
short_description,
thumbnail,
uri,
urls,
...instance
} = instanceV1Schema.parse(data);
@ -231,6 +233,7 @@ const instanceSchema = z.preprocess((data: any) => {
email: email,
},
description: short_description || description,
domain: uri,
pleroma: {
...pleroma,
metadata: {