MCPcopy Create free account
hub / github.com/code100x/cms / getPayoutMethods

Function getPayoutMethods

src/actions/payoutMethods/index.ts:126–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124};
125
126export const getPayoutMethods = async () => {
127 const session = await getServerSession(authOptions);
128
129 if (!session || !session.user.id) {
130 throw new Error('Unauthorized');
131 }
132 try {
133 const upiIds = await db.upiId.findMany({
134 where: {
135 userId: session.user.id,
136 },
137 });
138 const solanaAddresses = await db.solanaAddress.findMany({
139 where: {
140 userId: session.user.id,
141 },
142 });
143
144 if (!upiIds || !solanaAddresses) {
145 return { error: 'Failed to fetch payout methods' };
146 }
147
148 return { upiIds, solanaAddresses };
149 } catch (error) {
150 console.error(error);
151 return { error: 'Failed to fetch payout methods' };
152 }
153};
154const deleteUpiHandler = async (
155 data: DeleteTypePayoutMethod,
156): Promise<ReturnTypePayoutMethodDelete> => {

Callers 2

fetchPayoutMethodsFunction · 0.90
fetchPayoutMethodsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected