mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-12 00:38:36 +01:00
new selfhosted version
This commit is contained in:
14
dashboard/server/api/snapshot/list.ts
Normal file
14
dashboard/server/api/snapshot/list.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
import { ProjectSnapshotModel, TProjectSnapshot } from "@schema/project/ProjectSnapshot";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
const ctx = await getRequestContext(event, 'pid', 'permission:member');
|
||||
|
||||
const { project_id } = ctx;
|
||||
|
||||
const snapshots = await ProjectSnapshotModel.find({ project_id });
|
||||
|
||||
return snapshots.map(e => e.toJSON()) as TProjectSnapshot[];
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user