add connections
This commit is contained in:
@@ -16,14 +16,32 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Request, Response, Router } from "express";
|
||||
import { route } from "@fosscord/api";
|
||||
import { ConnectedAccount, ConnectedAccountDTO } from "@fosscord/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
//TODO
|
||||
res.json([]).status(200);
|
||||
const connections = await ConnectedAccount.find({
|
||||
where: {
|
||||
user_id: req.user_id,
|
||||
},
|
||||
select: [
|
||||
"external_id",
|
||||
"type",
|
||||
"name",
|
||||
"verified",
|
||||
"visibility",
|
||||
"show_activity",
|
||||
"revoked",
|
||||
"access_token",
|
||||
"friend_sync",
|
||||
"integrations",
|
||||
],
|
||||
});
|
||||
|
||||
res.json(connections.map((x) => new ConnectedAccountDTO(x, true)));
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user