frontend/composables/ExtendedDescription.ts
2024-08-28 00:23:29 +02:00

23 lines
518 B
TypeScript

import type { Client } from "@versia/client";
type ExtendedDescription = {
updated_at: string;
content: string;
};
export const useExtendedDescription = (client: MaybeRef<Client | null>) => {
if (!ref(client).value) {
return ref(null as ExtendedDescription | null);
}
const output = ref(null as ExtendedDescription | null);
ref(client)
.value?.getInstanceExtendedDescription()
.then((res) => {
output.value = res.data;
});
return output;
};