Skip to content

Commit

Permalink
Prod compilation fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
paxo-rch committed Nov 14, 2024
1 parent 79dda07 commit 2ad4eae
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions app/Controllers/Http/AppsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
})
}
Expand Down
3 changes: 1 addition & 2 deletions app/Controllers/Http/StoreController.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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 = ""
Expand Down
6 changes: 3 additions & 3 deletions app/Middleware/Auth.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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()) {
/**
Expand Down
3 changes: 1 addition & 2 deletions app/Models/App.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit 2ad4eae

Please sign in to comment.