mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
refactor: rename var
This commit is contained in:
@@ -33,7 +33,7 @@ const fileContent = async (ctx: any, next: any) => {
|
||||
hash: await file.hash(ctx.query.repo, ctx.query.path)
|
||||
})
|
||||
} else if (ctx.method === 'POST') {
|
||||
const oldHash = ctx.request.body.old_hash
|
||||
const { oldHash } = ctx.request.body
|
||||
|
||||
if (!oldHash) {
|
||||
throw new Error('No hash.')
|
||||
|
||||
@@ -99,7 +99,7 @@ export async function writeFile (file: Doc, content = '') {
|
||||
const result = await fetchHttp('/api/file', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ repo, path, content, old_hash: contentHash })
|
||||
body: JSON.stringify({ repo, path, content, oldHash: contentHash, asBase64 })
|
||||
})
|
||||
|
||||
return { hash: result.data }
|
||||
|
||||
Reference in New Issue
Block a user