mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 20:49:06 +01:00
[API] postにappを含めるように
This commit is contained in:
parent
7bc4535eec
commit
c99c398554
@ -6,6 +6,7 @@
|
|||||||
import * as mongo from 'mongodb';
|
import * as mongo from 'mongodb';
|
||||||
import Post from '../models/post';
|
import Post from '../models/post';
|
||||||
import Like from '../models/like';
|
import Like from '../models/like';
|
||||||
|
import serializeApp from './app';
|
||||||
import serializeUser from './user';
|
import serializeUser from './user';
|
||||||
import serializeDriveFile from './drive-file';
|
import serializeDriveFile from './drive-file';
|
||||||
import deepcopy = require('deepcopy');
|
import deepcopy = require('deepcopy');
|
||||||
@ -59,6 +60,11 @@ const self = (
|
|||||||
// Populate user
|
// Populate user
|
||||||
_post.user = await serializeUser(_post.user_id, me);
|
_post.user = await serializeUser(_post.user_id, me);
|
||||||
|
|
||||||
|
// Populate app
|
||||||
|
if (_post.app_id) {
|
||||||
|
_post.app = await serializeApp(_post.app_id);
|
||||||
|
}
|
||||||
|
|
||||||
if (_post.media_ids) {
|
if (_post.media_ids) {
|
||||||
// Populate media
|
// Populate media
|
||||||
_post.media = await Promise.all(_post.media_ids.map(async fileId =>
|
_post.media = await Promise.all(_post.media_ids.map(async fileId =>
|
||||||
|
Loading…
Reference in New Issue
Block a user