mirror of
https://github.com/whyour/qinglong.git
synced 2026-06-30 20:35:09 +08:00
修复环境变量拖拽
This commit is contained in:
@@ -89,7 +89,7 @@ export default class EnvService {
|
||||
fromIndex: number;
|
||||
toIndex: number;
|
||||
},
|
||||
) {
|
||||
): Promise<Env> {
|
||||
let targetPosition: number;
|
||||
const isUpward = fromIndex > toIndex;
|
||||
const envs = await this.envs();
|
||||
@@ -102,11 +102,11 @@ export default class EnvService {
|
||||
? (envs[toIndex].position + envs[toIndex - 1].position) / 2
|
||||
: (envs[toIndex].position + envs[toIndex + 1].position) / 2;
|
||||
}
|
||||
this.update({
|
||||
const newDoc = await this.update({
|
||||
_id,
|
||||
position: targetPosition,
|
||||
});
|
||||
await this.set_envs();
|
||||
return newDoc;
|
||||
}
|
||||
|
||||
public async envs(
|
||||
|
||||
Reference in New Issue
Block a user