export const getOrgAdapter = (
context: AuthContext,
options?: OrganizationOptions
) => {
const adapter = context.adapter;
return {
updateProjectAccess: async (
memberId: string,
data: {
projects: string[];
}
) => {
const { projects } = data;
const updated = await adapter.update({
model: "member",
where: [
{
field: "id",
value: memberId,
},
],
update: [{ field: "projects", value: projects }],
});
return {
projects,
};
},
}
}
export const getOrgAdapter = (
context: AuthContext,
options?: OrganizationOptions
) => {
const adapter = context.adapter;
return {
updateProjectAccess: async (
memberId: string,
data: {
projects: string[];
}
) => {
const { projects } = data;
const updated = await adapter.update({
model: "member",
where: [
{
field: "id",
value: memberId,
},
],
update: [{ field: "projects", value: projects }],
});
return {
projects,
};
},
}
}