Edit a file

When you want to edit an existing file, the app needs to load the content of that file.

Contents

Edit a file

Get a data ID handle

The app obtains a data ID handle for the versioned structured data (type tag 501) that contains the file you want to edit. The ID of this structured data is based on your user prefix and the name of the file.

Get data ID handle

POST /data-id/structured-data
store.js
safeDataId.getStructuredDataHandle(ACCESS_TOKEN, btoa(`${USER_PREFIX}:${filename}`), 501)

Get a structured data handle

The app obtains a structured data handle using the data ID handle of the file you want to edit.

Get structured data handle

GET /structured-data/handle/:dataIdHandle
store.js
safeStructuredData.getHandle(ACCESS_TOKEN, dataIdHandle)

After obtaining a structured data handle, the app drops the data ID handle of the file you want to edit.

Drop data ID handle

DELETE /data-id/:handleId
store.js
safeDataId.dropHandle(ACCESS_TOKEN, dataIdHandle)

Fetch the file

The app reads the latest version of the structured data using the structured data handle of the file you want to edit.

Read structured data

GET /structured-data/:handleId/:version?
store.js
safeStructuredData.readData(ACCESS_TOKEN, handleId, version)

The app displays the Markdown content for the latest version of the file you want to edit.

Edit a file

Fetch all versions

The app fetches all the versions of the file and displays them in the UI.

Fetch all versions

results matching ""

    No results matching ""