mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-03 01:06:39 +00:00
add site targets, client resources, and auto login
This commit is contained in:
@@ -43,17 +43,17 @@ export async function addUserSite(
|
||||
})
|
||||
.returning();
|
||||
|
||||
const siteResources = await trx
|
||||
.select()
|
||||
.from(resources)
|
||||
.where(eq(resources.siteId, siteId));
|
||||
|
||||
for (const resource of siteResources) {
|
||||
await trx.insert(userResources).values({
|
||||
userId,
|
||||
resourceId: resource.resourceId
|
||||
});
|
||||
}
|
||||
// const siteResources = await trx
|
||||
// .select()
|
||||
// .from(resources)
|
||||
// .where(eq(resources.siteId, siteId));
|
||||
//
|
||||
// for (const resource of siteResources) {
|
||||
// await trx.insert(userResources).values({
|
||||
// userId,
|
||||
// resourceId: resource.resourceId
|
||||
// });
|
||||
// }
|
||||
|
||||
return response(res, {
|
||||
data: newUserSite[0],
|
||||
|
||||
Reference in New Issue
Block a user