1nwf / Produx-v2

Found redundant literal in a logical expression JS-W1043
Anti-pattern
Minor
8 months ago8 months old
Logical expression with a literal operand will always evaluate to the same value
257            { productId: number; lastId?: number }
258        >({
259            query: ({ productId, lastId }) =>
260                `products/messages/${productId}/${lastId || 0}`,261        }),
262        updateUser: builder.mutation<void, any>({
263            query: (data: any) => ({
Logical expression with a literal operand will always evaluate to the same value
249            { postId: number; lastId?: number }
250        >({
251            query: ({ postId, lastId }) =>
252                `products/comments/${postId}/${lastId || 0}`,253            providesTags: ['Comments'],
254        }),
255        getChatMessages: builder.query<
Logical expression with a literal operand will always evaluate to the same value
165            { lastId?: number; productId: number; channel: string }
166        >({
167            query: ({ lastId, productId, channel }) =>
168                `products/posts/${productId}/${channel}/${lastId || 0}`,169            providesTags: ['Posts'],
170        }),
171        getProductInfo: builder.query<
Logical expression with a literal operand will always evaluate to the same value
109            query: ({ name, follow, accessToken }) => ({
110                url: `products/${follow ? 'follow' : 'unfollow'}/${name}`,
111                method: 'POST',
112                body: { accessToken: accessToken || '' },113            }),
114            invalidatesTags: ['User'],
115        }),
Logical expression with a literal operand will always evaluate to the same value
 66            { field: string; lastId?: number }
 67        >({
 68            query: ({ field, lastId }) =>
 69                `products/latest_posts/${field}/${lastId || 0}`, 70            providesTags: ['Posts', 'User'],
 71        }),
 72        getUserInfo: builder.query<UserInfo, void>({