monkeeShark/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts
2022-01-03 02:12:50 +09:00

23 lines
539 B
TypeScript

import $ from 'cafy';
import { ID } from '@/misc/cafy-id';
import define from '../../define';
import { getRemoteUser } from '../../common/getters';
import { updatePerson } from '@/remote/activitypub/models/person';
export const meta = {
tags: ['federation'],
requireCredential: true as const,
params: {
userId: {
validator: $.type(ID),
},
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async (ps) => {
const user = await getRemoteUser(ps.userId);
await updatePerson(user.uri!);
});