mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
new selfhosted version
This commit is contained in:
16
dashboard/server/api/share/info.ts
Normal file
16
dashboard/server/api/share/info.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ProjectShareModel } from "~/shared/schema/project/ProjectShareSchema";
|
||||
|
||||
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
const ctx = await getRequestContext(event, 'flag:allowAnon');
|
||||
const { linkId } = getQuery(event)
|
||||
const target = await ProjectShareModel.findOne({
|
||||
link: linkId?.toString()
|
||||
});
|
||||
if (!target) return;
|
||||
return {
|
||||
project_id: target.project_id,
|
||||
hasPassword: (target.password != undefined && target.password.length > 0)
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user