import { assert } from '@ember/debug';

export function buildOperationUrl(record, opPath, urlType, instance = true) {
  assert('You must provide a path for instanceOp', opPath);
  let modelName = record.constructor.modelName || record.constructor.typeKey;
  let adapter = record.store.adapterFor(modelName);
  let path = opPath;
  let snapshot = record._createSnapshot();
  let baseUrl = adapter.buildURL(modelName, instance ? record.get('id') : null, snapshot, urlType);

  if (baseUrl.charAt(baseUrl.length - 1) === '/') {
    return `${baseUrl}${path}`;
  } else {
    return `${baseUrl}/${path}`;
  }
}

export default buildOperationUrl;

@@ -1,44 +1,4 @@
-import %7B assert %7D from '@ember/debug';%0A%0A
 expo
@@ -75,68 +75,8 @@
 ) %7B%0A
-  assert('You must provide a path for instanceOp', opPath);%0A
   le
@@ -366,16 +366,58 @@
 Type);%0A%0A
+  if (!path) %7B%0A    return baseUrl;%0A  %7D%0A  %0A
   if (ba

Allow empty paths