blob: bfc91bb4cbc769f19c34aaba58b5124645d02e57 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
import config from '../../../config';
import { Users } from '../../../models';
import { User } from '../../../models/entities/user';
/**
* 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;
}
|