export const getSubDepartment = (departmentID = "") =>
  uni.$u?.http.post(
    "/organization/department/child",
    JSON.stringify({
      departmentIDs: [departmentID],
    }),
    {
      header: {
        token: uni.getStorageSync("BusinessToken"),
      },
    },
  );

export const getDepartmentUser = (departmentID = "") =>
  uni.$u?.http.post(
    "/organization/department/child",
    JSON.stringify({
      departmentID,
    }),
    {
      header: {
        token: uni.getStorageSync("BusinessToken"),
      },
    },
  );

export const getUserInDepartment = (userID) =>
  uni.$u?.http.post(
    "/organization/user/department",
    JSON.stringify({
      userIDs: [userID],
    }),
    {
      header: {
        token: uni.getStorageSync("BusinessToken"),
      },
    },
  );

export const searchInOrganization = (keyword) =>
  uni.$u?.http.post(
    "/user/search/organization/full",
    JSON.stringify({
      keyword,
      pagination: {
        pageNumber: 1,
        showNumber: 999,
      },
    }),
    {
      header: {
        token: uni.getStorageSync("BusinessToken"),
      },
    },
  );
