Skip to content

Commit

Permalink
Fixing the Integration ID being dropped during Episodic editing
Browse files Browse the repository at this point in the history
  • Loading branch information
CerealBoy committed Jul 6, 2024
1 parent 6ab17c7 commit 680d9fe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/types/collections.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ type AddEpisodic struct {
Title string `json:"title"`
Year int `json:"year"`

Integration string `json:"integration,omitempty"`
FilesystemID string `json:"filesystem,omitempty"`
Path string `json:"path,omitempty"`
Integration string `json:"integration,omitempty"`
FilesystemID string `json:"filesystem,omitempty"`
Path string `json:"path,omitempty"`
IntegrationID string `json:"integration_id,omitempty"`
}

type Episodic struct {
Expand Down Expand Up @@ -94,6 +95,7 @@ func (a AddEpisodic) Convert() (*Episodic, error) {
e.Title = a.Title
e.Year = a.Year
e.Path = a.Path
e.PublicDBID = a.IntegrationID

return e, nil
}
Expand Down
14 changes: 14 additions & 0 deletions src/components/EpisodicEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
:rules="[]" />
</div>

<v-text-field
density="comfortable"
:model-value="integration_id"
disabled
label="Integration ID" />

</v-card-text>

<v-card-actions>
Expand All @@ -80,6 +86,7 @@ export default {
path: '',
integrations: [],
filesystems: [],
integration_id: '',
rules: {
numerical: v => !/[^0-9]+/.test(v) || 'Numbers only.',
required: v => !!v || 'Required.',
Expand All @@ -94,13 +101,16 @@ export default {
this.loadDeps();
},
methods: {
close() {
this.loading = false;
this.dialog = false;
},
edit() {
this.dialog = true;
},
loadDeps() {
this.$store.dispatch('getFilesystems').then(() => {
this.filesystems = this.$store.getters.allFilesystems;
Expand All @@ -112,10 +122,12 @@ export default {
this.integration = this.episodic[this.id].episodic.integration_id;
this.filesystem = this.episodic[this.id].episodic.filesystem_id;
this.path = this.episodic[this.id].episodic.path;
this.integration_id = this.episodic[this.id].episodic.public_db_id;
});
});
});
},
run() {
this.loading = true;
this.$store.dispatch('updateEpisodic', {
Expand All @@ -126,12 +138,14 @@ export default {
integration: this.integration,
filesystem: this.filesystem,
path: this.path,
integration_id: this.integration_id,
},
}).then(() => {
this.close();
this.$emit('editComplete');
});
},
},
};
</script>
Expand Down

0 comments on commit 680d9fe

Please sign in to comment.