2024-08-28 00:23:29 +02:00
|
|
|
import type { Client } from "@versia/client";
|
2024-04-26 01:04:45 +02:00
|
|
|
|
2024-04-27 03:28:12 +02:00
|
|
|
type ExtendedDescription = {
|
|
|
|
|
updated_at: string;
|
|
|
|
|
content: string;
|
|
|
|
|
};
|
|
|
|
|
|
2024-08-28 00:23:29 +02:00
|
|
|
export const useExtendedDescription = (client: MaybeRef<Client | null>) => {
|
2024-04-27 06:50:30 +02:00
|
|
|
if (!ref(client).value) {
|
2024-04-27 03:28:12 +02:00
|
|
|
return ref(null as ExtendedDescription | null);
|
2024-04-26 01:04:45 +02:00
|
|
|
}
|
|
|
|
|
|
2024-04-27 03:28:12 +02:00
|
|
|
const output = ref(null as ExtendedDescription | null);
|
|
|
|
|
|
2024-04-27 06:50:30 +02:00
|
|
|
ref(client)
|
2024-06-08 01:09:15 +02:00
|
|
|
.value?.getInstanceExtendedDescription()
|
2024-04-27 06:50:30 +02:00
|
|
|
.then((res) => {
|
|
|
|
|
output.value = res.data;
|
|
|
|
|
});
|
2024-04-27 03:28:12 +02:00
|
|
|
|
|
|
|
|
return output;
|
2024-04-26 01:04:45 +02:00
|
|
|
};
|