chore: add all the code from original repo
This commit is contained in:
23
app/components/Settings/Profiles/actions/ProfilesAction.ts
Normal file
23
app/components/Settings/Profiles/actions/ProfilesAction.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
'use server';
|
||||
|
||||
import { initializeUser } from '../../../../../data/initializeUser';
|
||||
import prisma from '../../../../../prisma/prisma';
|
||||
|
||||
export async function ProfilesAction() {
|
||||
const user = await initializeUser();
|
||||
|
||||
try {
|
||||
const profiles = await prisma.profile.findMany({
|
||||
where: {
|
||||
userId: user.id
|
||||
},
|
||||
orderBy: {
|
||||
createdAt: 'desc'
|
||||
}
|
||||
});
|
||||
|
||||
return profiles;
|
||||
} catch (error) {
|
||||
throw new Error('Failed to find profiles');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user