pl-api: changes that don't even make sense
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@ -28,8 +28,8 @@ const preprocessAccount = v.transform((account: any) => {
|
|||||||
username,
|
username,
|
||||||
fqn,
|
fqn,
|
||||||
domain,
|
domain,
|
||||||
avatar_static: account.avatar_static || account.avatar,
|
avatar: account.avatar || account.avatar_static,
|
||||||
header_static: account.header_static || account.header,
|
header: account.header || account.header_static,
|
||||||
local: typeof account.pleroma?.is_local === 'boolean' ? account.pleroma.is_local : account.acct.split('@')[1] === undefined,
|
local: typeof account.pleroma?.is_local === 'boolean' ? account.pleroma.is_local : account.acct.split('@')[1] === undefined,
|
||||||
discoverable: account.discoverable || account.pleroma?.source?.discoverable,
|
discoverable: account.discoverable || account.pleroma?.source?.discoverable,
|
||||||
verified: account.verified || account.pleroma?.tags?.includes('verified'),
|
verified: account.verified || account.pleroma?.tags?.includes('verified'),
|
||||||
|
|||||||
@ -13,8 +13,7 @@ const groupSchema = v.pipe(v.any(), v.transform((group: any) => {
|
|||||||
const domain = getDomainFromURL(group);
|
const domain = getDomainFromURL(group);
|
||||||
|
|
||||||
if (group?.config) {
|
if (group?.config) {
|
||||||
return {
|
group = {
|
||||||
domain,
|
|
||||||
display_name: group.name,
|
display_name: group.name,
|
||||||
members_count: group.member_count,
|
members_count: group.member_count,
|
||||||
note: group.short_description,
|
note: group.short_description,
|
||||||
@ -30,7 +29,13 @@ const groupSchema = v.pipe(v.any(), v.transform((group: any) => {
|
|||||||
...group,
|
...group,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return { domain, ...group };
|
|
||||||
|
return {
|
||||||
|
domain,
|
||||||
|
...group,
|
||||||
|
avatar: group.avatar || group.avatar_static,
|
||||||
|
header: group.header || group.header_static,
|
||||||
|
};
|
||||||
}), v.object({
|
}), v.object({
|
||||||
avatar: v.fallback(v.string(), ''),
|
avatar: v.fallback(v.string(), ''),
|
||||||
avatar_static: v.fallback(v.string(), ''),
|
avatar_static: v.fallback(v.string(), ''),
|
||||||
|
|||||||
Reference in New Issue
Block a user