diff --git a/config/plugins.ts b/config/plugins.ts index 9c0cda8..503e3b4 100644 --- a/config/plugins.ts +++ b/config/plugins.ts @@ -2,6 +2,12 @@ module.exports = ({ env }) => ({ 'users-permissions': { config: { jwtSecret: env('ADMIN_JWT_SECRET'), + providers: { + google: { + clientId: env('GOOGLE_CLIENT_ID'), + redirectUri: 'muzikie://auth/callback', + }, + }, }, }, upload: { diff --git a/src/api/contribution/controllers/contribution.ts b/src/api/contribution/controllers/contribution.ts index 0765fdf..3f3cee5 100644 --- a/src/api/contribution/controllers/contribution.ts +++ b/src/api/contribution/controllers/contribution.ts @@ -40,6 +40,8 @@ export default factories.createCoreController('api::contribution.contribution', // Return the created contribution const sanitizedEntity = await this.sanitizeOutput(contribution, ctx); + + // before returning the value, make sure to update the Solana project too return this.transformResponse(sanitizedEntity); } catch (err) { ctx.throw(500, err); diff --git a/src/api/project/controllers/project.ts b/src/api/project/controllers/project.ts index d54282f..ad95481 100644 --- a/src/api/project/controllers/project.ts +++ b/src/api/project/controllers/project.ts @@ -314,11 +314,30 @@ export default factories.createCoreController( // Proceed with creating the the project const result = await super.create(ctx); - // TODO: Call the Smart Contract method here to register the project on the blockchain - // and if not created, revert the centralized project creation. + + // const wallet = await strapi.entityService.findMany( + // 'api::wallet.wallet', + // { + // users_permissions_user: user.id, + // }, + // ); + + // if(wallet.length) { + // // TODO: Call the Smart Contract method here to register the project on the blockchain + // // and if not created, revert the centralized project creation. + + + // // If the Smart contract interaction was unsuccessful, we have to delete the recently created + // // Project using result.data.id + // throw new Error(`Error transaction: ${result.data.id}`); + // } else { + // throw new Error('Wallet not found'); + // } + return result; } catch (err) { + // const id = err.message.split('Error transaction:')[1] ctx.throw(500, err); } },