Sh1be
Sh1be
Explore posts from servers
NNuxt
Created by Sh1be on 5/11/2024 in #❓・help
watching routes not working?
Hello, I've been trying to get route watching the query params to work. https://router.vuejs.org/guide/advanced/composition-api.html#Accessing-the-Router-and-current-Route-inside-setup I currently have a paginator component that modifies the route query params on click and I'm trying to watch for route query changes, but those seem to never occur. Following the docs, I got this code:
const route = useRoute();
const { data, error, refresh } = await useFetch("/api/items", {
query: route.query
});

watch(() => route.query, () => refresh())
const route = useRoute();
const { data, error, refresh } = await useFetch("/api/items", {
query: route.query
});

watch(() => route.query, () => refresh())
the refresh never happens. is my approach to pagination wrong? how can I fix this?
6 replies
NNuxt
Created by Sh1be on 4/14/2024 in #❓・help
middleware auth question
hello, when doing auth with nuxt3, where should i put my middleware to check if someone is authenticated? in the normal middleware or the server middleware? the middleware would ask the postgres db on my server if the user is authenticated.
2 replies
CC#
Created by Sh1be on 4/1/2024 in #help
Avalonia PDF editor app
Hello, I am looking for guidance on how I would write a PDF editing app, similar to Adobe Acrobat in C# with Avalonia. What PDF library should I pick that is able to edit & add new text & images to a PDF and do that within a GUI? Would I have to write my own library? How do the bigger apps do it, I couldn't find anything regarding that. Any help is appreciated!
72 replies
CC#
Created by Sh1be on 5/28/2023 in #help
❔ ffmpeg pipes
108 replies
CC#
Created by Sh1be on 12/21/2022 in #help
✅ System.Text.Json serialization problem
hello, I am using System.Text.Json. I have a struct that has 2 properties: a bool IsDefined and a T value. IsDefined gets set to true when value gets set. This is a container for properties that don't necessarily need to be set, but if they are set, they will get included in the serialization. The problem is that in the Write method, STJ automatically writes out the property name, which results in this Json if only the name property is set: {"name":"lol","parent_id":"position":}. The STJ write method:
if (!value.IsDefined) return;

switch (value.Value)
{
case long:
if (value.Value != null) writer.WriteStringValue(value.Value.ToString());
else writer.WriteNullValue();
break;

case ulong:
if (value.Value != null) writer.WriteStringValue(value.Value.ToString());
else writer.WriteNullValue();
break;

default:
writer.WriteRawValue(JsonSerializer.Serialize(value.Value));
break;
}
if (!value.IsDefined) return;

switch (value.Value)
{
case long:
if (value.Value != null) writer.WriteStringValue(value.Value.ToString());
else writer.WriteNullValue();
break;

case ulong:
if (value.Value != null) writer.WriteStringValue(value.Value.ToString());
else writer.WriteNullValue();
break;

default:
writer.WriteRawValue(JsonSerializer.Serialize(value.Value));
break;
}
How can I get around this?
222 replies
CC#
Created by Sh1be on 10/21/2022 in #help
Accessing data from another project
Hello, so I have 2 projects, one is an app that contains some data and the other project is a web api that is supposed to pull data from that first project. I tried achieving that by implementing an interface for the first project which i then add to the web api's dependency injection with the implementation pointing to the first project main file. So everytime i try to access data now from the running service (it has the data) in the web api, it just returns null. why is that happening?
105 replies