@iankibetsh/vue-streamline 1.2.8 → 1.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/vue-streamline",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "Vue library for streamlining laravel backend services with @iankibet/streamline composer package",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -112,17 +112,25 @@ const useStreamline = (stream, ...initialArgs) => {
112
112
  if(action.includes(':')){
113
113
  [newStream, action] = action.split(':')
114
114
  }
115
- const params = new URLSearchParams({
115
+ const post = {
116
116
  action,
117
- stream: newStream
118
- })
119
-
120
- // Add each arg as a separate param
121
- args.forEach((arg, index) => {
122
- params.append(`params[${index}]`, typeof arg === 'object' ? JSON.stringify(arg) : arg)
123
- })
124
-
125
- return `${streamlineUrl}?${params.toString()}`
117
+ stream:newStream,
118
+ params: args
119
+ }
120
+ return `${streamlineUrl}?${new URLSearchParams(post).toString()}`
121
+
122
+ // // Add each arg as a separate param
123
+ // args.forEach((arg, index) => {
124
+ // let value = arg;
125
+ // if (typeof arg === 'object' && !(arg instanceof Date)) {
126
+ // value = JSON.stringify(arg);
127
+ // } else if (arg instanceof Date) {
128
+ // value = arg.toISOString();
129
+ // }
130
+ // params.append(`params[${index}]`, value);
131
+ // })
132
+
133
+ // return `${streamlineUrl}?${params.toString()}`
126
134
  }
127
135
 
128
136
  const service = reactive({})