atproto explorer pdsls.dev
atproto tool

switch to applyWrites for updates

juli.ee c141b1fb 5cf1c762

verified
Changed files
+9 -4
src
components
+9 -4
src/components/create.tsx
···
return;
}
} else {
-
const res = await rpc.post("com.atproto.repo.putRecord", {
+
const res = await rpc.post("com.atproto.repo.applyWrites", {
input: {
repo: agent()!.sub,
-
collection: params.collection as `${string}.${string}.${string}`,
-
rkey: params.rkey!,
-
record: editedRecord,
validate: validate(),
+
writes: [
+
{
+
collection: params.collection as `${string}.${string}.${string}`,
+
rkey: params.rkey!,
+
$type: "com.atproto.repo.applyWrites#update",
+
value: editedRecord,
+
},
+
],
},
});
if (!res.ok) {