Leander
Leander
Explore posts from servers
NNuxt
Created by Leander on 1/26/2025 in #❓・help
Can not host nuxt app in local network
Hey, I am trying to host my nuxt app in my local network to test it on mobile devices. I run npm run dev -- --host. Nuxt acts like the --host argument is not there. I do not get the QR-Code like usual and it still tells me "use --host to expose"
17 replies
NNuxt
Created by Leander on 1/14/2025 in #❓・help
route validation method not called
Hello, I am currently stuck at the validation method on a page in my project. I try to validate the route based on a http request. I tried to return false right away in the validate() method, but still nothing happens. I also can not see console.logs i wrote in that function. Here is my code:
definePageMeta({
validate: async (route) => {
var spaceId = route.path.substring(route.path.lastIndexOf('/') + 1);

var validity = false

await $fetch(`${runtime.public.apiUrl}/spaces/${spaceId}`, {
method: 'GET',
onResponse: (response) => {
if (response.response.ok) {
validity = true
} else {
validity = false
}
}
})

return validity;
}
})
definePageMeta({
validate: async (route) => {
var spaceId = route.path.substring(route.path.lastIndexOf('/') + 1);

var validity = false

await $fetch(`${runtime.public.apiUrl}/spaces/${spaceId}`, {
method: 'GET',
onResponse: (response) => {
if (response.response.ok) {
validity = true
} else {
validity = false
}
}
})

return validity;
}
})
6 replies
NNuxt
Created by Leander on 1/5/2025 in #❓・help
useFetch will return "401 Unauthorized" on inital load
Hi, I am currently developing a frontend application using nuxt. The backend is made using ASP.NET and currently running in a docker container. When I login to my account in the backend, the login is saved in a cookie and this works fine. However when i use useFetch, I get 401 Unauthorized at first but when i go back and forth between the pages without reloading, I get the result I want. Just not on the initial load. The error goes away when I set server to false but I still only get the proper response when going back and forth between the pages.
7 replies
FFilament
Created by Leander on 5/22/2024 in #❓┊help
Action not working with requiresConfirmation()
Hello, I created a Livewire Component which implements HasForms and HasActions. I made a function "deleteAction" it works just fine but when adding requiresConfirmation(), I get the Modal but when pressing "confirm" nothing happens. I am pretty new to Filament and PHP in general. Here is the function code:
public function deleteAction(): Action
{
return Action::make('delete')
->action(function() {

error_log("TEST");
//Diagram::where('id', $this->diagram_id)->first()->delete();
})
->requiresConfirmation();
}
}
public function deleteAction(): Action
{
return Action::make('delete')
->action(function() {

error_log("TEST");
//Diagram::where('id', $this->diagram_id)->first()->delete();
})
->requiresConfirmation();
}
}
9 replies