Path: blob/master/src/packages/next/pages/api/v2/bookmarks/remove.ts
5823 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 remove(req));15} catch (err) {16res.json({ error: `${err.message}` });17return;18}19}2021async function remove(22req: Request,23): Promise<{24status: "success" | "error";25project_id?: string;26type?: string;27error?: string;28}> {29const { project_id, type } = req.body;3031// NOOP: Always return success since bookmarks are now handled by conat32switch (type) {33case STARRED_FILES: {34return { status: "success", project_id, type };35}3637default:38return { status: "error", error: `cannot handle type '${type}'` };39}40}4142export default handle;434445