class DockerService {
- fetchContainers = () => {
+ fetchContainers = ( { all = true } ) => {
return new Promise( async ( resolve, reject ) => {
try {
- const response = await axios.get( `${ base_url }${ DockerConfig.containers }` );
+ let containersUrl = new URL( `${ base_url }${ DockerConfig.containers }` );
+ containersUrl.searchParams.append('all', all ? "true" : "false" );
+ const response = await axios.get( containersUrl.toString() );
resolve( response.data.containers ); // Resolve the promise with the data
} catch (error) {
reject( `Error fetching containers: ${ error.message }` ); // Reject the promise with an error message