Files
misskey/packages/backend/src/remote/activitypub/renderer/follow-user.ts
syuilo d071d18dd7 refactor: Use ESM (#8358)
* wip

* wip

* fix

* clean up

* Update tsconfig.json

* Update activitypub.ts

* wip
2022-02-27 11:07:39 +09:00

13 lines
435 B
TypeScript

import config from '@/config/index.js';
import { Users } from '@/models/index.js';
import { User } from '@/models/entities/user.js';
/**
* Convert (local|remote)(Follower|Followee)ID to URL
* @param id Follower|Followee ID
*/
export default async function renderFollowUser(id: User['id']): Promise<any> {
const user = await Users.findOneOrFail(id);
return Users.isLocalUser(user) ? `${config.url}/users/${user.id}` : user.uri;
}