Path: blob/master/src/packages/next/pages/api/v2/bookmarks/get.ts
5844 views
/*1* This file is part of CoCalc: Copyright © 2024 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45// NOOP endpoint - bookmarks now handled by conat6// Keeping endpoint for backwards compatibility with older clients78import { Request } from "express";910import { STARRED_FILES } from "@cocalc/util/consts/bookmarks";1112async function handle(req, res) {13try {14res.json(await get(req));15} catch (err) {16res.json({ error: `${err.message}` });17return;18}19}2021async function get(22req: Request,23): Promise<{24status: "success" | "error";25stars?: string[];26type?: string;27project_id?: string;28error?: string;29}> {30const { type, project_id } = req.body;3132// NOOP: Always return empty bookmarks since they're now handled by conat33switch (type) {34case STARRED_FILES: {35return {36type,37project_id,38stars: [],39status: "success",40};41}4243default:44return {45type,46project_id,47status: "error",48error: `cannot handle type '${type}'`,49};50}51}5253export default handle;545556