! GhostvOne.tv πŸ‘»πŸ‡«πŸ‡·
! GhostvOne.tv πŸ‘»πŸ‡«πŸ‡·
Explore posts from servers
FFilament
Created by ! GhostvOne.tv πŸ‘»πŸ‡«πŸ‡· on 8/11/2024 in #β“β”Šhelp
❓ SpatieMediaLibraryFileUpload on repeater with relation doesn't work
Hi ! I'm trying to have a SpatieMediaLibraryFileUpload on every block generated by my repeater. I'm having an error :
Filament\Forms\Components\SpatieMediaLibraryFileUpload::Filament\Forms\Components\{closure}(): Argument #2 ($record) must be of type Spatie\MediaLibrary\HasMedia, Spatie\MediaLibrary\MediaCollections\Models\Media given, called in /app/vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 35
Filament\Forms\Components\SpatieMediaLibraryFileUpload::Filament\Forms\Components\{closure}(): Argument #2 ($record) must be of type Spatie\MediaLibrary\HasMedia, Spatie\MediaLibrary\MediaCollections\Models\Media given, called in /app/vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 35
2 replies
FFilament
Created by ! GhostvOne.tv πŸ‘»πŸ‡«πŸ‡· on 7/26/2024 in #β“β”Šhelp
Trying to have FileUpload works with my table
No description
8 replies
NNuxt
Created by ! GhostvOne.tv πŸ‘»πŸ‡«πŸ‡· on 4/18/2024 in #❓・help
NuxtLoadingIndicator doesn't work properly on nested page with lazy load
The loading indicator doesn't show on nested pages with lazy load for the page content. I tried to use to use start() before my lazy call but it doesn't work becausen nuxt stop finish() when the page is loaded
const loadingIndicator = useLoadingIndicator()
loadingIndicator.start()

const { data: resource, pending } = await useGetResourceGallery({
resource_id: parseInt(route.params.resource_id as string),
fetch_type: 'fetch',
})
const loadingIndicator = useLoadingIndicator()
loadingIndicator.start()

const { data: resource, pending } = await useGetResourceGallery({
resource_id: parseInt(route.params.resource_id as string),
fetch_type: 'fetch',
})
how Can I do ? I need a workarround
1 replies
NNuxt
Created by ! GhostvOne.tv πŸ‘»πŸ‡«πŸ‡· on 4/1/2024 in #❓・help
Middleware called 3 times instead of 2 ? (stackblitz reproduction)
Can you tell me why my middleware is called 3 times ? https://stackblitz.com/edit/github-3enzca-ixdqzf I have the same issue on my middlewares were I have redirections... It's always called 3 times. If I put logic outside middleware in setup, only 2 times happening.
15 replies
NNuxt
Created by ! GhostvOne.tv πŸ‘»πŸ‡«πŸ‡· on 3/25/2024 in #❓・help
Nested routes but not for all pages
No description
2 replies
NNuxt
Created by ! GhostvOne.tv πŸ‘»πŸ‡«πŸ‡· on 3/11/2024 in #❓・help
[useFetch] Component is already mounted, please use $fetch instead (in middleware)
I get this warning with useFetch in a middleware.
export default defineNuxtRouteMiddleware(async () => {
const { user } = useAuth()

const { data } = await useFetch('/api/auth/user')
user.value = data.value
})
export default defineNuxtRouteMiddleware(async () => {
const { user } = useAuth()

const { data } = await useFetch('/api/auth/user')
user.value = data.value
})
The documentation states: useFetch is a composable meant to be called directly in a setup function, plugin, or route middleware. I tried with useAsyncData too, but same erro. Do I have to make two separate middleware ? One using useFetch on server, and another using $fetch on client side ?? Or can I just use usefetch when process.server and $fetch when process.client ?
10 replies
NNuxt
Created by ! GhostvOne.tv πŸ‘»πŸ‡«πŸ‡· on 3/1/2024 in #❓・help
Hydratation issue using pinia store (stackblitz reproduction)
I'm having an issue with SSR rendering using pinia store. Here the issue : https://stackblitz.com/edit/github-6xitgs?file=stores%2FuseTestStore.ts,app.vue,nuxt.config.ts,components%2FTest.vue How can I fix this issue ? My ssr is not rendering correctly. I need to have my testStore.test to true in ssr mode like on my client. How to ? (you have to refresh the renderer page)
4 replies
NNuxt
Created by ! GhostvOne.tv πŸ‘»πŸ‡«πŸ‡· on 12/23/2023 in #❓・help
Can't having Usefetch working with Session/Cookies on SERVER SIDE ONLY (using laravel sanctum api)
Hello How can I have usefetch working perfectly with Session/Cookies on SERVER SIDE ONLY using laravel sanctum api. It works perfectly if my middleware is client side (if process.client) but doesn't work anymore if my middleware if server side only (process.server) If i'm using nuxt server side only Laravel is returning me this : CSRF token mismatch. Here my middleware
export default defineNuxtRouteMiddleware(async (to, from) => {
// skip middleware on client
if (process.client) return

const code = to.query.code as string

if (!code) {
return navigateTo('/')
}

const auth = useAuthStore()

if (auth.isLoggedIn) {
return navigateTo('/')
}

await useSanctumFetch('/sanctum/csrf-cookie')

const { data, error } = await useSanctumFetch('/login/discord', {
method: 'POST',
params: {
code: code,
},
})

const auth = useAuthStore()
if (data.value) auth.user = data.value.user as User

return navigateTo('/')
})
export default defineNuxtRouteMiddleware(async (to, from) => {
// skip middleware on client
if (process.client) return

const code = to.query.code as string

if (!code) {
return navigateTo('/')
}

const auth = useAuthStore()

if (auth.isLoggedIn) {
return navigateTo('/')
}

await useSanctumFetch('/sanctum/csrf-cookie')

const { data, error } = await useSanctumFetch('/login/discord', {
method: 'POST',
params: {
code: code,
},
})

const auth = useAuthStore()
if (data.value) auth.user = data.value.user as User

return navigateTo('/')
})
26 replies
DIAdiscord.js - Imagine an app
Created by ! GhostvOne.tv πŸ‘»πŸ‡«πŸ‡· on 6/29/2023 in #djs-questions
fetchStarterMessage on threadCreate doesn't work
I'm trying to fetch the first message when a thread (in a forum) is created. But it doesn't work. How can i Do ?
const { Events, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
const { getProjectCategories } = require('../managers/projectCategories');


module.exports = {
name: Events.ThreadCreate,
async execute(ThreadChannel) {
turn
}

setTimeout(async () => {
const Message = await ThreadChannel.fetchStarterMessage();
console.log(Message.content)
},5000)

ThreadChannel.fetchStarterMessage().then(Message => {
console.log(Message.content)
})
};
const { Events, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
const { getProjectCategories } = require('../managers/projectCategories');


module.exports = {
name: Events.ThreadCreate,
async execute(ThreadChannel) {
turn
}

setTimeout(async () => {
const Message = await ThreadChannel.fetchStarterMessage();
console.log(Message.content)
},5000)

ThreadChannel.fetchStarterMessage().then(Message => {
console.log(Message.content)
})
};
10 replies
DIAdiscord.js - Imagine an app
Created by ! GhostvOne.tv πŸ‘»πŸ‡«πŸ‡· on 6/29/2023 in #djs-questions
ActionRowBuilder in a new thread
Hello, how can I make an Action rows just after a thread creation ? I would like to moderate them and add after each new thread a row with two buttons ACCEPT / DECLINE. I'm looking into ActionRowBuilder but I don't know how to send that. is that the correct way to do ? Thanks (Another question : why the doc is so empty ?? Older docs was better to understand)
16 replies