supercompat 2.27.0 → 2.28.0
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/dist/index.cjs +8 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3935,7 +3935,7 @@ var get10 = function(param) {
|
|
|
3935
3935
|
var prisma = param.prisma;
|
|
3936
3936
|
return /*#__PURE__*/ function() {
|
|
3937
3937
|
var _ref = _async_to_generator(function(urlString) {
|
|
3938
|
-
var _this, url, _url_pathname_match, threadId, _ref, limit, order, after, messages3, _id;
|
|
3938
|
+
var _this, url, _url_pathname_match, threadId, _ref, limit, order, after, pageSize, messagesPlusOne, messages3, _id;
|
|
3939
3939
|
return _ts_generator(this, function(_state) {
|
|
3940
3940
|
switch(_state.label){
|
|
3941
3941
|
case 0:
|
|
@@ -3945,25 +3945,27 @@ var get10 = function(param) {
|
|
|
3945
3945
|
limit: "20",
|
|
3946
3946
|
order: "desc"
|
|
3947
3947
|
}, Object.fromEntries(url.searchParams)), limit = _ref.limit, order = _ref.order, after = _ref.after;
|
|
3948
|
+
pageSize = parseInt(limit);
|
|
3948
3949
|
return [
|
|
3949
3950
|
4,
|
|
3950
3951
|
prisma.message.findMany(_object_spread({
|
|
3951
3952
|
where: {
|
|
3952
3953
|
threadId: threadId
|
|
3953
3954
|
},
|
|
3954
|
-
take:
|
|
3955
|
+
take: pageSize + 1,
|
|
3955
3956
|
orderBy: {
|
|
3956
3957
|
createdAt: order
|
|
3957
3958
|
}
|
|
3958
|
-
}, after
|
|
3959
|
+
}, after && {
|
|
3959
3960
|
skip: 1,
|
|
3960
3961
|
cursor: {
|
|
3961
3962
|
id: after
|
|
3962
3963
|
}
|
|
3963
|
-
}
|
|
3964
|
+
}))
|
|
3964
3965
|
];
|
|
3965
3966
|
case 1:
|
|
3966
|
-
|
|
3967
|
+
messagesPlusOne = _state.sent();
|
|
3968
|
+
messages3 = messagesPlusOne.slice(0, pageSize);
|
|
3967
3969
|
return [
|
|
3968
3970
|
2,
|
|
3969
3971
|
new Response(JSON.stringify({
|
|
@@ -3973,7 +3975,7 @@ var get10 = function(param) {
|
|
|
3973
3975
|
});
|
|
3974
3976
|
}),
|
|
3975
3977
|
hasNextPage: function() {
|
|
3976
|
-
return
|
|
3978
|
+
return messagesPlusOne.length > pageSize;
|
|
3977
3979
|
},
|
|
3978
3980
|
last_id: (_id = (_this = (0, import_radash7.last)(messages3)) === null || _this === void 0 ? void 0 : _this.id) !== null && _id !== void 0 ? _id : null
|
|
3979
3981
|
}), {
|