From 2ad4eae0027765253905df427be13723b0715413 Mon Sep 17 00:00:00 2001 From: paxo-rch Date: Thu, 14 Nov 2024 12:09:01 +0100 Subject: [PATCH] Prod compilation fixed --- app/Controllers/Http/AppsController.ts | 6 +++--- app/Controllers/Http/StoreController.ts | 3 +-- app/Middleware/Auth.ts | 6 +++--- app/Models/App.ts | 3 +-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/Controllers/Http/AppsController.ts b/app/Controllers/Http/AppsController.ts index 49dfc31..7f4fed4 100644 --- a/app/Controllers/Http/AppsController.ts +++ b/app/Controllers/Http/AppsController.ts @@ -36,7 +36,7 @@ export default class AppsController { public async show({ view, params }: HttpContextContract) { const app = await App.query() .where('id', params.id) - .preload('author') + //.preload('author') .firstOrFail() return view.share({ app }).render('apps/product') @@ -65,9 +65,9 @@ export default class AppsController { userId: auth.user.id, name: data.name, desc: data.desc, - image: imgUrl, + //image: imgUrl, source_url: data.source_url, - releases: data.releases, + //releases: data.releases, category: data.categories }) } diff --git a/app/Controllers/Http/StoreController.ts b/app/Controllers/Http/StoreController.ts index e141b82..27b440c 100644 --- a/app/Controllers/Http/StoreController.ts +++ b/app/Controllers/Http/StoreController.ts @@ -1,6 +1,5 @@ import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext' import Application from '@ioc:Adonis/Core/Application' -import { v4 as uuidv4 } from 'uuid' import App from 'App/Models/App' import User from 'App/Models/User' import AdmZip from 'adm-zip' @@ -156,7 +155,7 @@ export default class StoreController } const timestamp = new Date().getTime() - const folderPath = `public_apps/${user.id}/${timestamp}` + const folderPath = `public_apps/${user.id}/${timestamp}` // absolute path in the public dir let app: App let directorytoremove = "" diff --git a/app/Middleware/Auth.ts b/app/Middleware/Auth.ts index c401410..c2e5d6d 100644 --- a/app/Middleware/Auth.ts +++ b/app/Middleware/Auth.ts @@ -1,4 +1,4 @@ -import { AuthenticationException } from '@adonisjs/auth/build/standalone' +//import { AuthenticationException } from '@adonisjs/auth/build/standalone' import type { GuardsList } from '@ioc:Adonis/Addons/Auth' import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext' import { UserType } from 'App/Models/User' @@ -31,10 +31,10 @@ export default class AuthMiddleware { * it can decide the correct response behavior based upon the guard * driver */ - let guardLastAttempted: string | undefined + // let guardLastAttempted: string | undefined // for prod for (const guard of guards) { - guardLastAttempted = guard + // guardLastAttempted = guard // for prod if (await auth.use(guard).check()) { /** diff --git a/app/Models/App.ts b/app/Models/App.ts index 1a8b4b2..26bbd88 100644 --- a/app/Models/App.ts +++ b/app/Models/App.ts @@ -1,6 +1,5 @@ import { DateTime } from 'luxon' -import { BaseModel, BelongsTo, belongsTo, column } from '@ioc:Adonis/Lucid/Orm' -import User from './User' +import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm' export enum AppCategory { // If you want to add an app category, append to the bottom and add translation in language files PRODUCTIVITY,