fix: actually detect rich text stuff
All checks were successful
create archive with lfs / tag (push) Successful in 9s
All checks were successful
create archive with lfs / tag (push) Successful in 9s
This commit is contained in:
parent
04006bda91
commit
9566e8627c
@ -2,6 +2,7 @@ import { env } from '$env/dynamic/private';
|
|||||||
import { PUBLIC_BASE_URL } from '$env/static/public';
|
import { PUBLIC_BASE_URL } from '$env/static/public';
|
||||||
import { bskyClient, loginToBsky } from '$lib';
|
import { bskyClient, loginToBsky } from '$lib';
|
||||||
import { createNote } from '$lib/notes.js';
|
import { createNote } from '$lib/notes.js';
|
||||||
|
import { RichText } from '@atproto/api';
|
||||||
import { get } from 'svelte/store';
|
import { get } from 'svelte/store';
|
||||||
|
|
||||||
interface NoteData {
|
interface NoteData {
|
||||||
@ -27,7 +28,14 @@ export const POST = async ({ request }) => {
|
|||||||
client = await loginToBsky()
|
client = await loginToBsky()
|
||||||
bskyClient.set(client)
|
bskyClient.set(client)
|
||||||
}
|
}
|
||||||
await client.post({text: `${noteData.content} (${PUBLIC_BASE_URL}/log?id=${noteId})`})
|
const rt = new RichText({
|
||||||
|
text: `${noteData.content} (${PUBLIC_BASE_URL}/log?id=${noteId})`,
|
||||||
|
})
|
||||||
|
await rt.detectFacets(client)
|
||||||
|
await client.post({
|
||||||
|
text: rt.text,
|
||||||
|
facets: rt.facets,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// send back created note id
|
// send back created note id
|
||||||
return new Response(JSON.stringify({ noteId }), {
|
return new Response(JSON.stringify({ noteId }), {
|
||||||
|
Loading…
Reference in New Issue
Block a user