set the returned file as the new file when saving a process model file so we get the new contents hash w/ burnettk

This commit is contained in:
jasquat 2023-05-04 16:59:27 -04:00
parent 20ee46899d
commit 998de63eca
2 changed files with 6 additions and 1 deletions

View File

@ -530,6 +530,8 @@ def _create_or_update_process_model_file(
file_contents = SpecFileService.get_data(process_model, file.name)
file.file_contents = file_contents
file.process_model_id = process_model.id
file_contents_hash = sha256(file_contents).hexdigest()
file.file_contents_hash = file_contents_hash
_commit_and_push_to_git(f"{message_for_git_commit} {process_model_identifier}/{file.name}")
return make_response(jsonify(file), http_status_to_return)

View File

@ -206,8 +206,11 @@ export default function ProcessModelEditDiagram() {
setProcessModelFileInvalidText('');
};
const navigateToProcessModelFile = (_result: any) => {
const navigateToProcessModelFile = (file: ProcessFile) => {
setDisplaySaveFileMessage(true);
if (file.file_contents_hash) {
setProcessModelFile(file);
}
if (!params.file_name) {
const fileNameWithExtension = `${newFileName}.${searchParams.get(
'file_type'