feat: notes and first item view
This commit is contained in:
13
src/modules/atproto/getUrl.ts
Normal file
13
src/modules/atproto/getUrl.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export const getUrl = async ({ did, rkey }: { did: string; rkey: string }) => {
|
||||
const response = await fetch(`https://plc.directory/${did}`)
|
||||
const {
|
||||
service: [{ serviceEndpoint }],
|
||||
} = await response.json()
|
||||
|
||||
const url = new URL("/xrpc/com.atproto.repo.getRecord", serviceEndpoint)
|
||||
url.searchParams.set("repo", did)
|
||||
url.searchParams.set("collection", "space.litenote.note")
|
||||
url.searchParams.set("rkey", rkey)
|
||||
|
||||
return url.toString()
|
||||
}
|
||||
Reference in New Issue
Block a user