refactor: Revise sync artifacts APIs

- /api/sync/artifacts: sync all artifacts
- /api/sync/artifact/:name: sync a specific artifact
This commit is contained in:
Peng-YM
2022-07-07 14:47:09 +08:00
parent a420c126c2
commit 240156daef
7 changed files with 120 additions and 82 deletions

View File

@@ -1,4 +1,4 @@
import { syncArtifact, produceArtifact } from '@/restful/artifacts';
import { syncToGist, produceArtifact } from '@/restful/artifacts';
import { version } from '../../package.json';
import { ARTIFACTS_KEY } from '@/constants';
import $ from '@/core/app';
@@ -33,7 +33,7 @@ console.log(
}),
);
const resp = await syncArtifact(files);
const resp = await syncToGist(files);
const body = JSON.parse(resp.body);
for (const artifact of allArtifacts) {