All files / client/methods deletefolder.js

100% Statements 5/5
100% Branches 0/0
100% Functions 3/3
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15            12x 2x 2x   2x   1x    
/* @flow */
 
import invariant from "invariant";
import type { MethodApi } from "../types";
 
export default ({ client }: MethodApi) =>
  (folderid: number): Promise<boolean> => {
    invariant(typeof folderid === "number", "`folderid must be a number.`");
    invariant(folderid, "`folderid` is required and can't be `0`.");
 
    return client
      .api("deletefolderrecursive", { params: { folderid: folderid } })
      .then(response => true);
  };