"use strict";
/* Get projects that the authenticated user is a collaborator on. */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const get_account_1 = __importDefault(require("lib/account/get-account"));
const get_1 = __importDefault(require("@cocalc/server/projects/get"));
const get_params_1 = __importDefault(require("lib/api/get-params"));
async function handle(req, res) {
    const account_id = await (0, get_account_1.default)(req);
    try {
        if (account_id == null)
            throw Error("must be authenticated");
        const { limit } = (0, get_params_1.default)(req);
        res.json(await (0, get_1.default)({ account_id, limit }));
    }
    catch (err) {
        res.json({ error: err.message });
    }
}
exports.default = handle;
//# sourceMappingURL=get.js.map