mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-11-04 04:57:51 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			521 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			521 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
/* global axios */
 | 
						|
 | 
						|
import PortalsAPI from './portals';
 | 
						|
 | 
						|
class ArticlesAPI extends PortalsAPI {
 | 
						|
  constructor() {
 | 
						|
    super('articles', { accountScoped: true });
 | 
						|
  }
 | 
						|
 | 
						|
  getArticles({ pageNumber, portalSlug, locale, status, author_id }) {
 | 
						|
    let baseUrl = `${this.url}/${portalSlug}/articles?page=${pageNumber}&locale=${locale}`;
 | 
						|
    if (status !== undefined) baseUrl += `&status=${status}`;
 | 
						|
    if (author_id) baseUrl += `&author_id=${author_id}`;
 | 
						|
    return axios.get(baseUrl);
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
export default new ArticlesAPI();
 |