Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 9ad838b

Browse files
feat: update attribute src in database
1 parent 99bef70 commit 9ad838b

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

studio/src/app/helpers/editor/editor.helper.tsx

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {SlideService} from '../../services/slide/slide.service';
99
import {DeckService} from '../../services/deck/deck.service';
1010
import {ErrorService} from '../../services/error/error.service';
1111
import {DeckBusyService} from '../../services/deck/deck-busy.service';
12+
import {SlideAttributes} from '../../models/slide-attributes';
1213

1314
export class EditorHelper {
1415

@@ -176,11 +177,35 @@ export class EditorHelper {
176177
return;
177178
}
178179

179-
await this.slideService.put({
180+
let attributes: SlideAttributes;
181+
182+
if (slide.getAttribute('style')) {
183+
attributes = {
184+
style: slide.getAttribute('style')
185+
};
186+
}
187+
188+
if (slide.getAttribute('src')) {
189+
if (!attributes) {
190+
attributes = {
191+
src: slide.getAttribute('style')
192+
};
193+
} else {
194+
attributes.src = slide.getAttribute('src');
195+
}
196+
}
197+
198+
const slideUpdate: Slide = {
180199
slide_id: slide.getAttribute('slide_id'),
181200
slide_template: SlideTemplate.TITLE,
182201
slide_content: slide.innerHTML
183-
});
202+
};
203+
204+
if (attributes) {
205+
slideUpdate.slide_attributes = attributes;
206+
}
207+
208+
await this.slideService.put(slideUpdate);
184209

185210
this.deckBusyService.busy(false);
186211

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export interface SlideAttributes {
22
style?: string;
3+
src?: string;
34
}

0 commit comments

Comments
 (0)