Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
article.js 691 B
Newer Older
  • Learn to ignore specific revisions
  • "use strict";
    
    class Article {
        constructor(data) {
            if (data) {
                this.from(data)
            } else {
                this.title = "";
                this.subtitle = "";
                this.category = "";
                this.details = [];
                this.images = [];
                this.body = "";
                this.locale = "";
    
                this.display_priority_index = 1;
    
    Pierre Jarriges's avatar
    Pierre Jarriges committed
                this.with_static_view = true;
    
                this.metadata = {
                    description: "",
                };
    
            }
        }
    
        from(data) {
            Object.entries(data).forEach(k_v => {
                const [key, value] = k_v;
                this[key] = value;
            });
        }
    }
    module.exports = Article;